[API] new functions for duplicated objects

A few additionnal functions for the Blender.Object module .
get/set functions for DupliFrames, DupliGroup, DupliRot, DupliNoSpeed.
Easy to do and perhaps usefull .

Example :


from Blender import Object
OBJECT=Object.Get('Cube')
print OBJECT.getDupliFrames()
OBJECT.setDupliFrames(1)
print OBJECT.getDupliGroup()
OBJECT.setDupliGroup(1)
print OBJECT.getDupliRot()
OBJECT.setDupliRot(1)
print OBJECT.getDupliNoSpeed()
OBJECT.setDupliNoSpeed(1)

More complicated :

Object_getDupliMatrices()
Be happy, it returns real matrices and one can play with in Mathutils functions .
Exemple :


import Blender
from Blender import Object, Scene
       
OBJET=Object.Get('Cube') #has dupliverts or dupliframes buts set
DUPLIOBJET=OBJET.getDupliMatrices()
if DUPLIOBJET!=[]:
   SCENE=Scene.GetCurrent()         
   for O in DUPLIOBJET:
     print DUPLIOBJET.index(O)
     E=Object.New('Empty') 
     SCENE.link(E)
     E.setMatrix(O)
Blender.Redraw()

The official patch (waiting to be commited, cambo ? anyone ? help !) :
https://projects.blender.org/tracker/download.php/9/127/3947/1858/duplitruematrices.patch

Mainwhile, try a cvs Blender version with this patch :
http://www.zoo-logique.org/3D.Blender/index.php3?zoo=com

Hi jms.

these functions will indeed be useful.

Trying out the patched version of blender to test it for functionality and bugs would be really useful. You can report results back here!

http://cobalt3d.free.fr/didacticiel/blender/tutor/images/nouveautes/testduplivertcurv.blend
http://cobalt3d.free.fr/didacticiel/blender/tutor/images/nouveautes/testduplivertdonut.blend
http://cobalt3d.free.fr/didacticiel/blender/tutor/images/nouveautes/testduplivertmtrx.blend

3 files to play with dupliverts .

and one for the dupliframes :
http://cobalt3d.free.fr/didacticiel/blender/tutor/images/nouveautes/testdupliframemtrx.blend

Nice, it is committed :
http://projects.blender.org/pipermail/bf-blender-cvs/2006-February/006113.html

Thanx to Cambo .