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:
21
doc/python_api/examples/bpy.props.4.py
Normal file
21
doc/python_api/examples/bpy.props.4.py
Normal file
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user