Merged from trunk with revision range 36835-37865,
(No conflicts had to be manually resolved) Gave weight paint a basic ability to draw edges and vertices with an option (with colors for selected/unselected), but I didn't make any vertex selection functions available in weight paint mode yet (tested with edit mode for now).
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
{%- macro relbar() %}
|
||||
<div class="subnav boxheader">
|
||||
<ul class="noprint"><li><a href="http://www.blender.org/development/coding-guides/">Coding Guides</a></li><li>•</li><li><a href="http://www.blender.org/development/report-a-bug/">Report a Bug</a></li><li>•</li><li><a href="http://www.blender.org/development/submit-a-patch/">Submit a Patch</a></li><li>•</li><li><a href="http://www.blender.org/development/release-logs/">Release Logs</a></li><li>•</li><li><a href="http://www.blender.org/development/current-projects/">Current Projects</a></li><li>•</li><li><a href="http://www.blender.org/development/architecture/">Architecture</a></li><li>•</li><li><a href="http://www.blender.org/development/building-blender/">Building Blender</a></li><li>•</li><li class="subnav-active"><a href="http://www.blender.org/documentation/250PythonDoc/contents.html">PyAPI</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Main_Page">Wiki</a></li></ul>
|
||||
<ul class="noprint"><li><a href="http://wiki.blender.org/index.php/Dev:Contents">Documentation</a></li><li>•</li><li><a href="http://www.blender.org/development/report-a-bug/">Report a Bug</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Doc/Process/Patches">Submit a Patch</a></li><li>•</li><li><a href="http://www.blender.org/development/release-logs/">Release Logs</a></li><li>•</li><li><a href="http://www.blender.org/development/building-blender/">Building Blender</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Doc/Projects">Current Projects</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Source/Architecture">Architecture</a></li><li>•</li><li><a href="http://www.blender.org/documentation/250PythonDoc/contents.html">Python API</a></li><li>•</li><li><a href="http://wiki.blender.org">Wiki</a></li></ul>
|
||||
</div>
|
||||
<div class="related subnav">
|
||||
<h3>{{ _('Navigation') }}</h3>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Update Example
|
||||
++++++++++++++
|
||||
|
||||
It can be useful to perform an action when a property is changed and can be
|
||||
used to update other properties or synchronize with external data.
|
||||
|
||||
All properties define update functions except for CollectionProperty.
|
||||
"""
|
||||
|
||||
import bpy
|
||||
|
||||
|
||||
def update_func(self, context):
|
||||
print("my test function", self)
|
||||
|
||||
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
|
||||
|
||||
bpy.context.scene.testprop = 11.0
|
||||
|
||||
# >>> my test function <bpy_struct, Scene("Scene")>
|
||||
@@ -21,3 +21,19 @@ with bpy.data.libraries.load(filepath, link=True) as (data_from, data_to):
|
||||
with bpy.data.libraries.load(filepath) as (data_from, data_to):
|
||||
for attr in dir(data_to):
|
||||
setattr(data_to, attr, getattr(data_from, attr))
|
||||
|
||||
|
||||
# the 'data_to' variables lists are
|
||||
with bpy.data.libraries.load(filepath) as (data_from, data_to):
|
||||
data_to.scenes = ["Scene"]
|
||||
|
||||
|
||||
# the loaded objects can be accessed from 'data_to' outside of the context
|
||||
# since loading the data replaces the strings for the datablocks or None
|
||||
# if the datablock could not be loaded.
|
||||
with bpy.data.libraries.load(filepath) as (data_from, data_to):
|
||||
data_to.meshes = data_from.meshes
|
||||
# now operate directly on the loaded data
|
||||
for mesh in data_to.meshes:
|
||||
if mesh is not None:
|
||||
print(mesh.name)
|
||||
|
||||
@@ -345,9 +345,9 @@ Utility functions
|
||||
|
||||
.. function:: getAverageFrameRate()
|
||||
|
||||
Gets the estimated average framerate
|
||||
|
||||
:return: The estimed average framerate in frames per second
|
||||
Gets the estimated/average framerate for all the active scenes, not only the current scene.
|
||||
|
||||
:return: The estimated average framerate in frames per second
|
||||
:rtype: float
|
||||
|
||||
.. function:: getBlendFileList(path = "//")
|
||||
|
||||
@@ -710,6 +710,12 @@ Game Engine bge.types Module
|
||||
|
||||
Applies changes to a camera.
|
||||
|
||||
.. attribute:: damping
|
||||
|
||||
strength of of the camera following movement.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: min
|
||||
|
||||
minimum distance to the target object maintained by the actuator.
|
||||
|
||||
@@ -696,3 +696,199 @@ Renamed
|
||||
* **force** -> :class:`bpy.types.MaterialPhysics.fh_force`
|
||||
* **use_normal_align** -> :class:`bpy.types.MaterialPhysics.use_fh_normal`
|
||||
|
||||
|
||||
2.57 to 2.58
|
||||
============
|
||||
|
||||
bpy.types.RenderSettings
|
||||
------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.RenderSettings.use_bake_lores_mesh`
|
||||
* :class:`bpy.types.RenderSettings.use_bake_multires`
|
||||
|
||||
bpy.types.Camera
|
||||
----------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Camera.show_guide`
|
||||
|
||||
bpy.types.SpaceImageEditor
|
||||
--------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SpaceImageEditor.zoom`
|
||||
|
||||
bpy.types.SpaceView3D
|
||||
---------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SpaceView3D.lock_camera`
|
||||
|
||||
bpy.types.RegionView3D
|
||||
----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.RegionView3D.is_perspective`
|
||||
|
||||
bpy.types.Scene
|
||||
---------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Scene.frame_subframe`
|
||||
|
||||
bpy.types.Area
|
||||
--------------
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **active_space**
|
||||
|
||||
bpy.types.DisplaceModifier
|
||||
--------------------------
|
||||
|
||||
Renamed
|
||||
^^^^^^^
|
||||
|
||||
* **texture_coordinate_object** -> :class:`bpy.types.DisplaceModifier.texture_coords_object`
|
||||
|
||||
bpy.types.UserPreferencesView
|
||||
-----------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UserPreferencesView.use_camera_lock_parent`
|
||||
|
||||
bpy.types.DomainFluidSettings
|
||||
-----------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.DomainFluidSettings.fluid_mesh_vertices`
|
||||
* :class:`bpy.types.DomainFluidSettings.surface_noobs`
|
||||
|
||||
bpy.types.Sculpt
|
||||
----------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Sculpt.use_deform_only`
|
||||
|
||||
bpy.types.ClothCollisionSettings
|
||||
--------------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ClothCollisionSettings.distance_repel`
|
||||
* :class:`bpy.types.ClothCollisionSettings.repel_force`
|
||||
|
||||
bpy.types.UILayout
|
||||
------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UILayout.template_edit_mode_selection`
|
||||
|
||||
bpy.types.ToolSettings
|
||||
----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ToolSettings.use_snap_project_self`
|
||||
|
||||
bpy.types.Mesh
|
||||
--------------
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **edge_face_count**
|
||||
* **edge_face_count_dict**
|
||||
* **edge_loops_from_edges**
|
||||
* **edge_loops_from_faces**
|
||||
|
||||
bpy.types.PointDensity
|
||||
----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.PointDensity.falloff_curve`
|
||||
* :class:`bpy.types.PointDensity.falloff_speed_scale`
|
||||
* :class:`bpy.types.PointDensity.use_falloff_curve`
|
||||
|
||||
bpy.types.SpaceTextEditor
|
||||
-------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SpaceTextEditor.use_match_case`
|
||||
|
||||
bpy.types.CameraActuator
|
||||
------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.CameraActuator.damping`
|
||||
|
||||
bpy.types.Property
|
||||
------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Property.is_skip_save`
|
||||
|
||||
bpy.types.UserPreferencesSystem
|
||||
-------------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UserPreferencesSystem.anisotropic_filter`
|
||||
|
||||
bpy.types.Object
|
||||
----------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Object.empty_image_offset`
|
||||
|
||||
bpy.types.Image
|
||||
---------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Image.resolution`
|
||||
|
||||
bpy.types.SceneGameData
|
||||
-----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SceneGameData.use_glsl_color_management`
|
||||
|
||||
|
||||
@@ -24,17 +24,17 @@ Dump the python API into a text file so we can generate changelogs.
|
||||
output from this tool should be added into "doc/python_api/rst/change_log.rst"
|
||||
|
||||
# dump api blender_version.py in CWD
|
||||
blender --background --python intern/tools/rna_api_dump.py -- --dump
|
||||
blender --background --python doc/python_api/sphinx_changelog_gen.py -- --dump
|
||||
|
||||
# create changelog
|
||||
blender --background --python intern/tools/rna_api_dump.py -- \
|
||||
blender --background --python doc/python_api/sphinx_changelog_gen.py -- \
|
||||
--api_from blender_2_56_1.py \
|
||||
--api_to blender_2_57_0.py \
|
||||
--api_out changes.rst
|
||||
|
||||
|
||||
# Api comparison can also run without blender
|
||||
python intern/tools/rna_api_dump.py
|
||||
python doc/python_api/sphinx_changelog_gen.py \
|
||||
--api_from blender_api_2_56_6.py \
|
||||
--api_to blender_api_2_57.py \
|
||||
--api_out changes.rst
|
||||
|
||||
@@ -34,7 +34,8 @@ For HTML generation
|
||||
|
||||
- Generate html docs by running...
|
||||
|
||||
sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
|
||||
cd doc/python_api
|
||||
sphinx-build sphinx-in sphinx-out
|
||||
|
||||
assuming that you have sphinx 1.0.7 installed
|
||||
|
||||
@@ -64,8 +65,9 @@ else:
|
||||
"bpy.props",
|
||||
"bpy.utils",
|
||||
"bpy.context",
|
||||
# "bpy.types", # supports filtering
|
||||
"bpy.types", # supports filtering
|
||||
"bpy.ops", # supports filtering
|
||||
#"bpy_extras",
|
||||
"bge",
|
||||
"aud",
|
||||
"bgl",
|
||||
@@ -204,10 +206,24 @@ def write_indented_lines(ident, fn, text, strip=True):
|
||||
'''
|
||||
if text is None:
|
||||
return
|
||||
for l in text.split("\n"):
|
||||
if strip:
|
||||
fn(ident + l.strip() + "\n")
|
||||
else:
|
||||
|
||||
lines = text.split("\n")
|
||||
|
||||
# strip empty lines from the start/end
|
||||
while lines and not lines[0].strip():
|
||||
del lines[0]
|
||||
while lines and not lines[-1].strip():
|
||||
del lines[-1]
|
||||
|
||||
if strip:
|
||||
ident_strip = 1000
|
||||
for l in lines:
|
||||
if l.strip():
|
||||
ident_strip = min(ident_strip, len(l) - len(l.lstrip()))
|
||||
for l in lines:
|
||||
fn(ident + l[ident_strip:] + "\n")
|
||||
else:
|
||||
for l in lines:
|
||||
fn(ident + l + "\n")
|
||||
|
||||
|
||||
@@ -252,7 +268,7 @@ def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True):
|
||||
|
||||
fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
|
||||
if py_func.__doc__:
|
||||
write_indented_lines(ident + " ", fw, py_func.__doc__.strip())
|
||||
write_indented_lines(ident + " ", fw, py_func.__doc__)
|
||||
fw("\n")
|
||||
|
||||
|
||||
@@ -267,8 +283,10 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
|
||||
if type(descr) == GetSetDescriptorType:
|
||||
fw(ident + ".. attribute:: %s\n\n" % identifier)
|
||||
write_indented_lines(ident + " ", fw, doc, False)
|
||||
fw("\n")
|
||||
elif type(descr) in (MethodDescriptorType, ClassMethodDescriptorType):
|
||||
write_indented_lines(ident, fw, doc, False)
|
||||
fw("\n")
|
||||
else:
|
||||
raise TypeError("type was not GetSetDescriptorType, MethodDescriptorType or ClassMethodDescriptorType")
|
||||
|
||||
@@ -316,11 +334,17 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
|
||||
attribute_set = set()
|
||||
filepath = os.path.join(BASEPATH, module_name + ".rst")
|
||||
|
||||
module_all = getattr(module, "__all__", None)
|
||||
module_dir = sorted(dir(module))
|
||||
|
||||
if module_all:
|
||||
module_dir = module_all
|
||||
|
||||
file = open(filepath, "w")
|
||||
|
||||
fw = file.write
|
||||
|
||||
write_title(fw, title, "=")
|
||||
write_title(fw, "%s (%s)" % (title, module_name), "=")
|
||||
|
||||
fw(".. module:: %s\n\n" % module_name)
|
||||
|
||||
@@ -331,6 +355,35 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
|
||||
|
||||
write_example_ref("", fw, module_name)
|
||||
|
||||
# write submodules
|
||||
# we could also scan files but this ensures __all__ is used correctly
|
||||
if module_all is not None:
|
||||
submod_name = None
|
||||
submod = None
|
||||
submod_ls = []
|
||||
for submod_name in module_all:
|
||||
ns = {}
|
||||
exec_str = "from %s import %s as submod" % (module.__name__, submod_name)
|
||||
exec(exec_str, ns, ns)
|
||||
submod = ns["submod"]
|
||||
if type(submod) == types.ModuleType:
|
||||
submod_ls.append((submod_name, submod))
|
||||
|
||||
del submod_name
|
||||
del submod
|
||||
|
||||
if submod_ls:
|
||||
fw(".. toctree::\n")
|
||||
fw(" :maxdepth: 1\n\n")
|
||||
|
||||
for submod_name, submod in submod_ls:
|
||||
submod_name_full = "%s.%s" % (module_name, submod_name)
|
||||
fw(" %s.rst\n\n" % submod_name_full)
|
||||
|
||||
pymodule2sphinx(BASEPATH, submod_name_full, submod, "%s submodule" % module_name)
|
||||
del submod_ls
|
||||
# done writing submodules!
|
||||
|
||||
# write members of the module
|
||||
# only tested with PyStructs which are not exactly modules
|
||||
for key, descr in sorted(type(module).__dict__.items()):
|
||||
@@ -348,15 +401,15 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
|
||||
if descr.__doc__:
|
||||
fw(".. data:: %s\n\n" % key)
|
||||
write_indented_lines(" ", fw, descr.__doc__, False)
|
||||
attribute_set.add(key)
|
||||
fw("\n")
|
||||
attribute_set.add(key)
|
||||
|
||||
del key, descr
|
||||
|
||||
classes = []
|
||||
|
||||
for attribute in sorted(dir(module)):
|
||||
for attribute in module_dir:
|
||||
if not attribute.startswith("_"):
|
||||
|
||||
if attribute in attribute_set:
|
||||
continue
|
||||
|
||||
@@ -972,6 +1025,8 @@ def rna2sphinx(BASEPATH):
|
||||
fw(" blf.rst\n\n")
|
||||
if "aud" not in EXCLUDE_MODULES:
|
||||
fw(" aud.rst\n\n")
|
||||
if "bpy_extras" not in EXCLUDE_MODULES:
|
||||
fw(" bpy_extras.rst\n\n")
|
||||
|
||||
# game engine
|
||||
if "bge" not in EXCLUDE_MODULES:
|
||||
@@ -1068,41 +1123,45 @@ def rna2sphinx(BASEPATH):
|
||||
# python modules
|
||||
if "bpy.utils" not in EXCLUDE_MODULES:
|
||||
from bpy import utils as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities (bpy.utils)")
|
||||
pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities")
|
||||
|
||||
if "bpy.path" not in EXCLUDE_MODULES:
|
||||
from bpy import path as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.path", module, "Path Utilities (bpy.path)")
|
||||
pymodule2sphinx(BASEPATH, "bpy.path", module, "Path Utilities")
|
||||
|
||||
if "bpy_extras" not in EXCLUDE_MODULES:
|
||||
import bpy_extras as module
|
||||
pymodule2sphinx(BASEPATH, "bpy_extras", module, "Extra Utilities")
|
||||
|
||||
# C modules
|
||||
if "bpy.app" not in EXCLUDE_MODULES:
|
||||
from bpy import app as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data (bpy.app)")
|
||||
pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data")
|
||||
|
||||
if "bpy.props" not in EXCLUDE_MODULES:
|
||||
from bpy import props as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions (bpy.props)")
|
||||
pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions")
|
||||
|
||||
if "mathutils" not in EXCLUDE_MODULES:
|
||||
import mathutils as module
|
||||
pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities (mathutils)")
|
||||
pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities")
|
||||
|
||||
if "mathutils.geometry" not in EXCLUDE_MODULES:
|
||||
import mathutils.geometry as module
|
||||
pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities (mathutils.geometry)")
|
||||
pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities")
|
||||
|
||||
if "mathutils.geometry" not in EXCLUDE_MODULES:
|
||||
import blf as module
|
||||
pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing (blf)")
|
||||
pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing")
|
||||
|
||||
# XXX TODO
|
||||
#import bgl as module
|
||||
#pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper (bgl)")
|
||||
#pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper")
|
||||
#del module
|
||||
|
||||
if "aud" not in EXCLUDE_MODULES:
|
||||
import aud as module
|
||||
pymodule2sphinx(BASEPATH, "aud", module, "Audio System (aud)")
|
||||
pymodule2sphinx(BASEPATH, "aud", module, "Audio System")
|
||||
del module
|
||||
|
||||
## game engine
|
||||
|
||||
Reference in New Issue
Block a user