merge with trunk r39834
This commit is contained in:
@@ -23,11 +23,6 @@ with bpy.data.libraries.load(filepath) as (data_from, 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.
|
||||
|
||||
19
doc/python_api/examples/bpy.types.ID.user_clear.1.py
Normal file
19
doc/python_api/examples/bpy.types.ID.user_clear.1.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
User Clear
|
||||
++++++++++
|
||||
This function is for advanced use only, misuse can crash blender since the user
|
||||
count is used to prevent data being removed when it is used.
|
||||
"""
|
||||
|
||||
# This example shows what _not_ to do, and will crash blender.
|
||||
import bpy
|
||||
|
||||
# object which is in the scene.
|
||||
obj = bpy.data.objects["Cube"]
|
||||
|
||||
# without this, removal would raise an error.
|
||||
obj.user_clear()
|
||||
|
||||
# runs without an exception
|
||||
# but will crash on redraw.
|
||||
bpy.data.objects.remove(obj)
|
||||
Reference in New Issue
Block a user