python access current evaluated dopObject in modifyDataDop?

   2275   2   0
User Avatar
Member
47 posts
Joined: March 2010
Offline
How do I access current evaluate dopObject in modifyDataDop?
expression like dopoption('.', $OBJID, ‘Position’, ‘density’) seems execute once for current enolove object.

currently, I am using pwd().simulation().findObject(expandString('$OBJNAME'))
in modifiedDataDop to access current evaluate dopObject, which I am not sure if this is the proper way to do it ?? What would be a proper way for doing this??

Is there any accessing method for dopObject similar like curPoint() access in sop for current evaluating point??
User Avatar
Member
19 posts
Joined: Sept. 2011
Offline
I'm sure you already found the solution because this is long time ago but I thought it's good to share this.

curOBJ = pwd().simulation().findObject(expandString('$OBJNAME'))
density = curOBJ.findSubData('Position').options().field('density')

Actually, “findObject” code saved my life.

Thanks,
Ryoji
User Avatar
Member
47 posts
Joined: March 2010
Offline
hi, jyoji, I am glad that help.

What bother me is modifyDataDop seems to run once with current solved object per step. while in hscript, $OBJID returns current evaluated object handle. But in python, findObject is used to query this handle from all iterate object prior the object get accessible.

It is alike access per point in VOP directly and vice verse of running an extra for loop inside VOP to gain access to the iterate point. It is ok for few objects, but not thousands in massive destruction scene as number of iteration increasing significantly.

But, that is just my doubt!! I have no proof of how frequent modifyDataDop runs nor how $OBJID is handle internally.
  • Quick Links