In Blender 2.49b, when I use the update() on an armature, every bone in the armature is deleted. However, if I don’t use update(), the changes my script made to the armature are not made in Blender. I tested it by doing nothing more in the interactive console than just getting the armature and calling update() on the armature, and it still deleted all the bones in the armature. The armature object still exists, but all the bones are gone.
I think it depends what exactly your code does… You may need pose.update() rather than arma.update(), provided your armatura object is called “arma”. Frankly, I think (and I use this) it is better (not very fair in theory though) to go in and get out of EDIT mode (or vice-versa depending of the window state - OBJECT/EDIT mode). This ALWAYS causes redraw and update of the object(s). I know it is no good to advise you so but the trick works at me with no further complications. Furthermore, in most cases you would need redraw anyway.
You’d need to check your code too… If it deletes the bones of your armature then at any kind of update you will have your bones deleted!
Actually, I tried running the script, commenting out the update(). The bones were not deleted but the armature was not modified. Here is the code of the program:
import Blender from Blender import * source_armature = "Armature" size = 0.5 ao = Blender.Object.Get(source_armature) a = ao.getData() for b in a.bones.keys(): bb = a.bones[b] h = [ bb.head['ARMATURESPACE'] , bb.head['ARMATURESPACE'] , bb.head['ARMATURESPACE'] ] t = [ bb.tail['ARMATURESPACE'] , bb.tail['ARMATURESPACE'] , bb.tail['ARMATURESPACE'] ] bb.head['ARMATURESPACE'] = Blender.Mathutils.Vector(size*h , size*h , size*h) bb.tail['ARMATURESPACE'] = Blender.Mathutils.Vector(size*t , size*t , size*t) # a.update() Blender.Redraw()
The code basically resizes an armature without changing the size values for the armature or the bones. I tried the following script (which does pretty much nothing except update() ) and it still deleted the bones:
import Blender from Blender import * source_armature = "Armature" ao = Blender.Object.Get(source_armature) a = ao.getData() a.update()