vec.normalized()
mat.inverted()
mat.transposed()
made vec/float possible
normalize/invert/transpose now return None because they modify the data in place.
use the ...(ed) versions to return a modified copy.
Fixed Memory leaks from not decreffing PyFloat_AS_DOUBLE from these python functions...
(found when testing above functions)
ob.rbMass
ob.rbRadius
matrix.determinant()
quat*float
vec*float
matrix.transpose()
EXPP_setModuleConstant
Checked all instances of PyFloat_AS_DOUBLE so I dont think there are any mroe leaks there.
-fixing object.getMatrix("localspace") and object.matrixLocal to return
the local matrix (returns global space matrix if the object doesn't
have a parent).
Nkey "Properties Panel" now has Dimension ("Dim") buttons too.
This reads from the actual bounding box value to see the size. Note that
dimensions for animated & deformed objects will change per frame.
(Cleaned up buttons layout for patch, and added support for Curve, Text and
Surface objects)
- the new methods will advance an object's pose correctly to any frame
Example:
myobj = Blender.Object.Get('obert')
for x in range(10):
myobj.evaluatePose(x)
pose = myobj.getPose()
print 'Data at Frame %d' % x
for bone in pose.bones.values():
print bone.head, bone.tail
print bone.head, bone.tail
New Constraint API. Constraints are accessible through a "constraints"
attribute in poses and objects. Would be REALLY NICE for armature users to
pound on this code.
wiki with info: http://mediawiki.blender.org/index.php/BlenderDev/PyDrivers
(there are two sample .blends in the patch tracker entry, last link in
the wiki page)
Notes:
In usiblender.c I just made Python exit before the main library gets
freed. I found a situation with pydrivers where py's gc tried to del
objects on exit and their ID's were not valid anymore (so sigsegv).
Ton needs to check the depsgraph part.
For now pydrivers can reference their own object, something normal
ipodrivers can't. This seems to work fine and is quite useful, but if
tests prove the restriction is necessary, we just need to uncomment a
piece of code in EXPP_interface.c, marked with "XXX".
Thanks Ton for the ipodrivers code and adding the hooks for the py part
and Martin for the "Button Python Evaluation" patch from which I started
this one.
Anyone interested, please check the wiki, the .blends (they have
README's) and tell me about any issue.
implicit declarations, redundant redeclarations, missing initializers,
nested externs and other cruft.
Cleaned up includes and moved extern _Type decls from Types.h into
Types.c since that is the only place where they are needed now.
Did not touch Ipo.[ch] since work is on-going there.
This is very confusing.
Since in object has
ob.setDupliGroup() # Enable/Disable Dupligroup
ob.getDupliGroup() # see if its enabled.
ob.dupliGroup # the group data this object is instancing.
Not yet added
ob.groups # Groups that use this object.
counting, causing "Error Totblock" messages on exit due to memory not being
freed. Added a call to test_object_materials() after the new data is linked.
Made some fixes and changes.
* The matricies returned were wrapped. Wrapping Display Mesh matricies segfaulted sometimes. - Made a copy instead.
* Added 1 missing epydoc from the patch.
* Renamed getDupliMatrices to getDupliObjects, and changed to return a list of (object, matrix) tuples instead of just the matrix. This is much more usefull because it allows python to know what objects are used for dupliGroups and for dupliverts where there is more then 1 child. also cleaned up this function a bit.
Allow object.setMatrix() to accept 3x3 matrices by extending to a 4x4
internally. Also check the dimensions of the new matrix and throw an
exception if not a 3x3 or 4x4.
Here are my notes on things to look out for as potential problem
spots:
source/blender/blenkernel/intern/displist.c:
+ is initfastshade(void) supposed to be empty? I had
to make it empty to get the merged tree to compile.
source/blender/python/api2_2x/Armature.c:
+ went with the version that had Armature_getLayers()
source/blender/python/api2_2x/Object.c
+ went with the version of Object_getPose() from bf-blender.
(#ifdef 0-ed the other version)
source/blender/python/api2_2x/Pose.[ch]
+ had problems linking due to no Pose_Init() ... copied these
two files straight from bf-blender.
source/blender/src/drawview.c:
+ view3d_panel_properties() had things shifted a few things shifted
a few pixels, otherwise, things were painless
source/blender/src/splash.jpg.c:
+ went with bf-blender version (orange is dead)
source/gameengine:
+ went with bf-blender version -- does not compile due to IMB_rect* stuff,
Ton should look into this.
patch from jean-michel soler (jms) - .insertShapeKey()
Python API, a function to insert a shape key in an object . It works on Mesh, Lattice curve ans surface .
Example of use :
import Blender
OBJECT=Blender.Object.GetSelected()[0]
OBJECT.insertShapeKey()
a docstring to follow soon
- adds object.getPose
- ability to manipulate poses /posebones
- fixes a overflow bug in matrix sequence accessor
- adds code to get vec/roll from mat3
- few internal fixes to NLA
- ability to set bone matrices
TypeError for pythonCoder error.
RuntimeError for blender not being able to be joined. (Sorry stivs, no BadJuJu yet)
Documented this in the epydocs also.
Object.GetSelected now dosnt return None if there is no 3d view. - wasnt documented and likely would mess up scripts that always expected a list. - Just return an empty list instead.
eg.
ret_val = ob.join(objects)
Now it dosent depend on the current selection, or change the selection context.
Made respective join_* functions return 0 if the join was not mode, 1 when it workes.
Changed Pythons Object.Duplicate() to take keyword parms to enable duplication of spesific data.
Eg- Object.Duplicate(mesh=1) # to duplicate mesh data also.
Object.Join()
Seperated the join calls from space.c and view3dmenu into join_menu() in space.c, like the select_group_menu(),
okee's from join_curve, join_mesh.. etc are in join_menu() so python can call them without UI menu's in the way.
this is also a bit neater since there were 2 places that were doing what join_menu() does now.
- Cam