[Bf-blender-cvs] [6fbf05f] master: Make python gotchas more clear (regarding handling of stale data)

Gaia Clary noreply at git.blender.org
Mon Apr 13 11:00:57 CEST 2015


Commit: 6fbf05f326911d10e6227837f8b5de1d86f950b2
Author: Gaia Clary
Date:   Mon Apr 13 10:59:47 2015 +0200
Branches: master
https://developer.blender.org/rB6fbf05f326911d10e6227837f8b5de1d86f950b2

Make python gotchas more clear (regarding handling of stale data)

===================================================================

M	doc/python_api/rst/info_gotcha.rst

===================================================================

diff --git a/doc/python_api/rst/info_gotcha.rst b/doc/python_api/rst/info_gotcha.rst
index 35f9c1b..aad2311 100644
--- a/doc/python_api/rst/info_gotcha.rst
+++ b/doc/python_api/rst/info_gotcha.rst
@@ -86,9 +86,15 @@ Consider the calculations that might go into working out the object's final tran
 To avoid expensive recalculations every time a property is modified, Blender defers making the actual calculations until they are needed.
 
 However, while the script runs you may want to access the updated values.
+In this case you need to call :class:`bpy.types.Scene.update` after modifying values, for example:
+
+.. code-block:: python
+
+   bpy.context.object.location = 1, 2, 3
+   bpy.context.scene.update()
 
-This can be done by calling :class:`bpy.types.Scene.update` after modifying values which recalculates all data that is tagged to be updated.
 
+Now all dependent data (child objects, modifiers, drivers... etc) has been recalculated and is available to the script.
 
 Can I redraw during the script?
 -------------------------------




More information about the Bf-blender-cvs mailing list