was missing context property attributes - context.mode for example. add RNA properties into context docs.
also minor updates
- exclude freestyle if its not enabled.
- add missing context member.
while the docs said it followed the settings in the Output panel, other file
formats work now.
Benderplayer still only saves PNG now as documented, but I cleaned up the code
there to reuse existing imbuf functions rather than using own libpng code.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.
=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.
Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].
=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].
The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.
[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
(so one can find more about the joystick class without having to search joystick)
code untested by the way. Sorry but I can no longer build sphinx docs here. I will try to fix that later.
- update man page for new additions since last release.
- note that --start-console argument is windows only.
- correct own assertion in own recent commit.
* Undoing the previous applyMovement() changes for characters. This was causing bugs for the Motion Actuator.
* Creating a Character Motion type for the Motion Actuator with specific controls for characters. This includes moving, rotating and jumping.
* Adding a KX_CharacterWrapper.walkDirection to set the character's direction and speed.
Note, this also resolves the following bugs:
[#33585] "Setting dLoc of motion actuator [0,0,0] via python won't stop object" reported by Manuel Bellersen (urfoex)
[#33503] "Character physics type won´t accept more than one motion anymore" reported by Mr Larodos
from Patrick Boelens (senshi). with modifications to split it into its own function.
also added C style multi-line comment support /* ... */
I've left out the part of this patch that sets the language in the space, since I think this might be better stored in the text block.
For now it simply uses OSL syntax highlighting when the extension is '.osl'.
# Print a message when an async LibLoad is done
import bge
def finished_cb(status):
print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))
bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb
LibLoad() now returns a KX_LibLoadStatus object for information on the library loading. LibNew() and LibFree() are unaffected by this commit. In other words, the async option only works for LibLoad(). Furthermore it only works for Scenes, not Actions or Meshes.
if bge.logic.joysticks[0]:
activate_player_one()
if bge.logic.joysticks[1]:
activate_player_two()
etc..
The interface exposed by SCA_PythonJoystick is very similar to the joystick logic brick except for one key difference: axis values are normalized to a -1.0 to 1.0 range instead of -32767 to 32767, which is what the logic brick exposed.
- Blender/Python Addon Tutorial: a step by step guide on how to write an addon from scratch
- Blender/Python API Reference Usage: examples of how to use the API reference docs
Thanks to John Nyquist for editing these docs and giving feedback.
also minor edits to py-api-ref
-- This line, and those below, will be ignored--
M doc/python_api/sphinx_doc_gen.py
M doc/python_api/rst/include__bmesh.rst
M source/blender/modifiers/intern/MOD_solidify.c
* jump() -- causes the character to jump
* onGround -- specifies whether or not the character is on the ground
* gravity -- controls the "gravity" that the character physics uses for the character
More options could be added (such as jump speed, step height, make fall speed, max slope, etc).
2 new attributes to ImageViewport and ImageRender object:
depth: set to True to retrieve the depth buffer as an array of float
(not suitable for texture source).
zbuff: set to True to retrieve the depth buffer as a grey scale pixel array
(suitable for texture source).
A new mode 'F' is added to VideoTexture.imageToArray() to allow returning the image
buffer as a one dimensional array of float. This mode should only be used to retrieve
the depth buffer of ImageViewport and ImageRender objects.
Example:
viewport = VideoTexture.ImageViewport()
viewport.depth = True
depth = VideoTexture.imageToArray(viewport,'F')
# show depth of bottom left pixel
# 1.0 = infinite, 0.0 = on near clip plane.
print(depth[0])
* KX_GameObject.member returns the list of group members if the object is a group object, otherwise None is returned
* KX_GameObject.group returns the group object that the object belongs to or None if the object is not part of a group
the idea of using methods instead of attributes is to avoid users abusing of the system calls.
Thanks Campbell Barton for reviewing and small corrections
KX_RadarSensor.angle was returning the angle that was used to construct Bullet's physics shape, which is calculated from the logic brick gui. KX_RadarSensor.angle now recalculates the original value from the gui. However, m_coneradius isn't actually used by KX_RadarSensor that I can see, so it might be better to just assign the original angle to m_coneradius instead of the calculated value. I've also made KX_RadarSensor.angle read-only, since setting m_coneradius does not appear to have any affect, which means writing to KX_RadarSensor.angle never worked properly.
- new compositor could use uninitialized var
- profile conversion could use uninitialized var
- set better warnings for clang+cmake.
- remove picky warnings from sphinx doc gen shell script.
worth noticing is that the example in bpy.types.Mesh is wrong too (Mesh type does not have an uv element)
but I would prefer someone more familiar with bmesh to take a look at those
added access to deform weights, access to weights acts like a python dict so you can do...
print(group in dvert)
dvert[group] = 0.5
print(dvert[group])
del dvert[group]
print(dvert.items())
This also makes it clearer that the faces are for tessellated results only.
Added a section on the Gotcha's about upgrading scripts, the pros and cons of MeshTessFace/MeshPoly/BMFace.
and spesifically how to upgrade importers and exporters for 2.63+.
- add examples for custom-data access
- group BMesh types logically in docs
- added missing docstrings
needed to add grouping functionality to sphinx for this.
Small fixes (thanks Terry Wallwork for reporting)
- adding logger filehandler in main () so that ARGS.output_dir exists, otherwise we get an IOError
- the zip was not including files in a container directory
Committing a patch similar to revision 44887 with fixes to my own bugs
(sorry Campbell, and thanks for reviewing :)
Fixes
------
- examples/ svn directory not removed anymore (in-source builds possible again)
- fixed "include references somehow stopped working"
+ using shutils.makearchive() to zip the file
New command line options
------------------------
-l: Log the output of the api dump and sphinx|latex warnings and errors
If given, save logs in:
* OUTPUT_DIR/.bpy.log
* OUTPUT_DIR/.sphinx-build.log
* OUTPUT_DIR/.sphinx-build_pdf.log
* OUTPUT_DIR/.latex_make.log
(using only one log directive instead of -l for bpy and -L for sphinx)
-P: builds the pdf
-R: pack the files in a dir ready for online deployment
(including the zip and the pdf eventually)
Example usage:
./blender.bin -b -P doc/python_api/sphinx_doc_gen.py -- -p bmesh* -o ./<OUTPUTDIR> -B -P -R -l
sphinx_doc_gen.sh broke building docs -
- examples/ svn directory was being removed since it assumed an out-of-source build.
- include references somehow stopped working (didnt find why).
also fixed an unrelated error with building docs in object_utils.py
New command line options:
-l: logs bpy dumping problems in OUTPUT_DIR/.bpy.log
-L: logs sphinx|latex problems in:
* OUTPUT_DIR/.sphinx-build.log (sphinx building html problems)
* OUTPUT_DIR/.sphinx-build_pdf.log (sphinx building latex problems)
* OUTPUT_DIR/.latex_make.log (latex make problems)
-P: builds the pdf
-R: pack the files in a dir ready for online deployment
(including the zip and the pdf eventually)
Example usage:
./cmake/bin/blender -b -P ./blender/doc/python_api/sphinx_doc_gen.py -- -p bmesh* -l -o ./python_api -B -P -R -L
- Enhanced the -T option:
- we can now choose among custom themes (now 'blender-org' and later 'naiad')
and Sphinx internal themes (use -h option to see which ones)
- choosing a custom theme will copy the theme dir to the output dir
- Added two new command line options:
-N: Add the theme name to the html dir name
For example, if we choose the theme 'haiku'
with using -N will create html files in sphinx-out_haiku/
Useful to test separate themes without overwriting the smae folder each time
-B: Builds the html docs running sphinx-build
This is useful to avoid runing sphinx with a separate shell command
- Fixed the URL in undocumented_message()
(sphinx_doc_gen.py)
- file reorganization to use more functions (easier to read)
- adapting to work after a recent commit that made some of the members of bpy.app.*
output bytes instead of strings (see [#30154])
- a couple of new command line optionsto avoid editing the script:
-T: let you choose the sphinx theme: the theme dir get copied in the destination dir
-b: choose if we want the bpy module page or not
Current command line arguments optional arguments:
-h, --help show this help message and exit
-o OUTPUT_DIR, --output OUTPUT_DIR
Path of the API docs (default=<script dir>)
-T SPHINX_THEME, --sphinxtheme SPHINX_THEME
Sphinx theme (default='default')
-f, --fullrebuild Rewrite all rst files in sphinx-in/ (default=False)
-t, --testdump Dumps a small part of the API (default=False)
-b, --bpy Write the rst file of the bpy module (default=False)
(rst/info_best_practice.rst)
- fixed a typo
Also adds DampedTrackTo to the list of supported constraints in the BGE
Test file:
http://www.pasteall.org/blend/11715
Patch developed as part of a project to NF-UBC Nereus Program.
Development time 'sponsored' by the project.
www.nereusprogram.org
- Works in macOSX now (hackish)
(TODO: not check for OSX explicitly but handle exception if it fails)
- We can now generate rst files outside out of the source (was annoying)
- Moved some vars at module level
- Managing the command line args with argparse.
Example usage:
./cmake/bin/blender -b -P ./blender/doc/python_api/sphinx_doc_gen.py -- -o ./python_api