[Bf-python] Implementing bpy.classes

Campbell Barton cbarton at metavr.com
Wed Jun 27 21:00:11 CEST 2007


>>> Example: using object.dup.objects, object.dup.group, etc. instead of
>>> Maybe object.dyn[amics] or object.physics to group all rigid and soft
>>> body and particle interaction vars: object.dyn.sb.mass,
> 
> i am not sure if sb needs to be under dyn, but when working a bit with 
> Object.c i had the same conclusion that e.g. softbody would be better 
> separated from there - perhaps with a new Softbody wrapper type for handling 
> those settings, that an object either has or not (in which case the ref at 
> ob.softbody would be null/None)
> 
> i am not convinced that Campbell's counterarguments stand against that idea ;)
> e.g. having ob.softbody.mass
> 
> ~Toni

Looking at DNA_object_types.h

there are...

typedef struct Object {
     ....
     struct PartDeflect *pd;		/* particle deflector/attractor/collision 
data */
     struct SoftBody *soft;		/* if exists, saved in file */
     struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, 
store additional settings */

} Object;


Since these are optional data structures attached to the object Im not 
so against making these separate in python also, however this is not 
something Id like to see done with common variables you might want to 
access in a loop. (location, parent, modifiers, ipo action etc)

ob.softbody.mass
ob.fluidsim.ipo
ob.particle.forcefield




More information about the Bf-python mailing list