*found a way* get corrective morph assignement to a joint via script?
Singular3D
Posts: 529
Genesis 3 Female has corrective morphs assigned to the joints via add multiply or spline (e.g. pJCMPelvisFwd_25)
In the file pJCMPelvisFwd_25.dsf theer are parameters like type, label, min/max, but also the values in "formulas" available.
"formulas" : [ { "output" : "Genesis3Female:#pJCMPelvisFwd_25?value", "operations" : [ { "op" : "push", "url" : "pelvis:/data/DAZ%203D/Genesis%203/Female/Genesis3Female.dsf#pelvis?rotation/x" }, { "op" : "push", "val" : -0.04 }, { "op" : "mult" } ] } ],
Is there a method to get all these values from the bone via script and how? Any idea or hint into the right direction and where to look?
Thanks and best regards
Walter
Post edited by Singular3D on
Comments
I'm not sure. It's possible to get controllers, but I can't recall how (or if it is possible) to get the controlled proerpties, which is what you want here. Going from the figure, you could get its shape, then the shape's modifiers, then the vlaue channel, then its controller list, then get the properties for those and look for those that are the bends on your bone.
Thanks for your reply. I hoped that there will be an attribute of the DzNode that I missed. I don't need the morph data itself, but only the assignement. I have a similar issue with lFoot and lHeel that have interconnected rotations and I wonder, if I can get these things from Daz Studio with a script. I'll have a look at the figure/shape thing too.
Hi Richard,
I did a little search and maybe somewhere here is the information I'm seraching for
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/property_dz
There is a method getControllerList() for a specific property, which may cover the ERC stuff I'm after. The Methods of DzNumericProperty and DzFloatProperty are interesting as well. I'll let you know, when I find something.
Yes, that's what I was sugesting using - but it gives you the list of cotnrollers, not the list of controlled proerpties, so you need the corrective morphs (from the figure node) and then you can go from those to the bends that control them and check to see if they are the bone of interest.
I'm a little stuck at the moment.
I select a bone/joint and then I use this script
The result is the following output for the lThighBend
getControllerList() probably provides an array of controller_dz objects, but I cannot find any definition of this type. So I'm a bit lost how to continue.
controller_dz : getController( Number idx )
Return Value:
The i'th controller on this property
Array : getControllerList()
Return Value:
A list of the controllers on this property
You could get getClassName() to find out which kind of controller it was - the DS3 scripting docs http://docs.daz3d.com/doku.php/public/software/dazstudio/3/start should fill in the gaps but name should work on the controllers.
Wow, you're fast
I used
and I get
I will have a look at the old 3.x documentation.
The 3.x docs are very helpful. I found
If I change the script,
I get
Nice!
Now I wonder where the sub-components can be found
e.g. ERC [Delta-Add] > Genesis 3 Female:pJCMThighFwd_115_L
I don't see a way to go from controller to sub-component, though I did think it was possible (and that I'd done it).
The node should be a controller for the sub-component, so maybe I have to go through all ERCLinks and find out if a specific node is the controller.
Rob should know..
Yes, that's what I meant (going through the links checking the controller - Rob's knowing goes without saying).
Hmm, but how do I get all ERCLinks? Is there a function somewhere? The morph is linked to a node. Is there a function to get all morphs in a scene, so that I can go through them. Thanks for your great help by the way!
The morphs belong to the shape, which in turn belongs to the figure (not the bones). So go through the modifiers on the figure and you will get the morphs (among other things).
By figure you mean a DzSkeleton or simply a DzObject, which has methods like getModifier and getShape? The question is how do I get DzObject? Via the DzScene?
In the case of rigged figures the geometry (which has the shape modifiers) is owned by the figure node (Genesis 3 female or whatever) rather than by a bone. So you need the figure (DzNode.getSkeleton()), then from that you get the DzObject (.getObject()), then you use getNumModifiers() for that and iterate using getModifier( n )
Thanks a lot. By the way: I wrote a PDF with 28 pages so far about joints and some basic technical information. I'd like to share this here as sort of give-back. What would be the best place to do so?
Maybe in a thread in the technical discussion?
That would be very welcome to a lot of people. Technical Discussion might work, or Daz Studio Discussion since it is application-specific, or the Freebies forum.
Uploaded the first 5 chapters in Daz Studio Discussion. Thanks again for your help and guidence.
I also attached a little script and the result/dump in the log file to this post. Might be helpful as well for someone.
I just selected the Left Thigh Bend and executed the script.
Thank you for this. Does this list include all the JCMs on the figure?