Anybody fancy doing a (freebie) DAZ Script version of Easypose ?
Several months ago I wrote a freebie PoserPython script to add Ajax-type Easypose to a figure - released as Freazypose (prototype 0.10) at ShareCG.
Inevitably I've had a query as to whether it'll work in DAZ Studio, which of course it won't.
However, the PoserPython script is only 359 lines in total. Half of those are probably comments and blank lines for layout, and half of what's left is probably dialogues and information pop-ups. So I reckon maybe 100 lines of actual PoserPython.
The two key PoserPyton API calls to add Easypose were...:
- actor.CreateValueParameter() ... to add new master dials
- parameter.AddValueOperation() ... to slave the required parameters on other actors to the master dial
...and the section of the PoserPython script that does this is lines 288-361 (in case anybody downloads the thing from ShareCG to have a look)
* * * * * * * * * * * * * * * * * *
I'm very rusty on DAZ Script, but I think a 'DzNode' corresponds to an 'actor' and a'DzNodeProperty' to a 'parameter'.
However, when I look at the method lists in the documentation ( http://docs.daz3d.com/doku.php/public/software/dazstudio/3/start - downloaded years ago) my brain jumps into neutral...
So the questions are:
- Does DAZScript have the necessary API callsto do this ?
- If so,then does anybody fancy giving it a go ? I don't.
- (or perhaps mCasual has already done this ?)
Comments
Rob has several sample scripts relevant to this:
I will add that it's not too hard to create properties and link them, I've written several scripts that do this over the years for one reason or another
Thanks Richard. I've had a quick look at those sample scripts and... well, I can't make head or tail of them.
However, when I looked at the the DAZ Script Object Index again to see if DzERCFreezeAction was there I spotted the DzERCLink class - the ERCDeltaAdd value for its ERCType has a reassuring ring of familiarity about it. That seems to be what I need for the PoserPython parameter.AddValueOperation() bit.
Also DzElement::addProperty() seems to be what's needed to add a master dial - the PoserPython actor.CreateValueParameter() bit.
So...maybe I will have a look at it myself...
Yes, those are the objects and methods I've used.
I just grabbed this (really old - it was fixing a bug in DS 1.8) code for creating an ERC link given a figure (node) and names/values for the things to link and how to link them:
@3dcheapskate, can you give a brief description of what EasyPose does?
Just add a slider bar for the figure's current pose?
Long, flexible things such as a tentacles, tails, ropes, chains, etc, are made up of a large number of segments, each having their own bone.
Easypose is for easily posing them. The figure creator would use Ajax EasyPose Underground to incorporate Easypose into the figure. The end user would simply use the Easypose master dials to pose the bendy-twisty bits of the figure.
In the old days (BA - Before Ajax ;o) ) you had to manually set the rotation dials (usually labelled 'Twist', 'Bend' and 'Side-Side') for each segment/bone, which was a total pain in the a*** !
Easypose adds dials (or sliders in DS terminology) that automate this. It basically creates a number of new 'master' dial, appropriately labelled, in (usually) the Body actor of the figure and slaves all the appropriate dials in the relevant segments/bones to it.
So instead of having to manually set each 'Bend' dial of your tentacle to 10, you simply set the new Easypose 'BendAll' dial in the Body of the figure to 10, and all the relevant segment/bone 'Bend' dials are automatically set for you.
As well as BendAll, TwistAll, SideSideAll it adds master dials for spiral bends and S-curves (and more recent EasyPose adds catenary curves too). It also adds master dialson each appropriate bone/segment to only bend/twist/sideside after or before that specific bone/segment.
Note: If you see sliders labelled BendAll, TwistAll, SideSideAll in any of your figures then they were almost certainly created using the old Ajax Easypose Underground
(I wonder whether any of SickleYield's rigging stuff handles easypose?)
Don't forget that DS allows multi-selection, so there's less need for EasyPose-type controls - though they still add convenience.
Good point.
I guess that multi-selection should work where the same value is to be applied to a number of segments/bones, i.e equivalent EasyPose master dials BendAll, TwistAll, SideSideAll, BendBefore, BendAfter, TwistBefore, TwistAfter, SideSideBefore and SideSideAfter. So for those it's just maybe a little bit simpler for the user ... if they can remember/find which body part the master dial is in !
But when you want to apply different values to each bone/segment (EasyPose master dials for Spiral, S-Bend and Catenary) that wouldn't work would it ?
Thank you ! I'll pass that information on to the person who raised the original question (i.e. does my FreazyPose work in DAZ Studio) - that sounds like a probable solution for them.
(and it means I don't have to switch my brain from PoserPython mode to DAZ Script mode. It's never worked very well in either mode and nowadays it's seizing up due to rust ! )
Thanks again. I'm just sending an email via ShareCG to direct them to this thread.
P.S. I recall that Rob (rbtwhiz) was one of the originators of the whole ERC thing way, way back. And now a light bulb is dimly glowing in my brain - the script sample that Richard directed me to was all about 'ERC Freeze'...
So yes, you can call me slow...
Just opened DS4.9 and tried this ERC Freeze thingy.
It looks quite easy (just as SY said), but I'm obviously missing something in (refer to attached collage here...) step 4,"Set up the gobbledigook...".
So what do I need to do to add my "BendAll" dial slider (to control xrot for Arm1-25) to the root node ("Basic Tentacle (25seg)") ?
You need to right-click on the property you want to drive the ERC, or create a new proeprty to drive the ERC. It looks as if you are right-clicking on one of the existing rotations, which isn't usually desirable for this use.
Link ?
Okay, so I think this is how I create my master slider...
..and then I say which things are slaved to it, i.e. just the xRots of Arm01 to Arm25)...
So according to the Property Hierarchy I now have an 'XROT ALL' controlin bone 'Arm01' (I can't seemto add it to the root node, 'Basic Tentacle (25seg)'? - edit: yes I can!).
But I can't find it on the main UI Parameters or Posing tabs. Found it/them - see next post
P.S. I'm using an old DS (4.9.4.117(64bit) from the beta channel?) as that's the most recent DS I have installed
Okay, I just found it (my XROT ALL slider - under 'Display' on the Parameters tab) - and it seems to work as expected
Also found the one I tried to add to the root node, so that did work.
@Dimorphic - A belated thank you for the tutorial link
I'm now trying to use ERC Freeze for real for the first time, and I'm posting all the problems I'm having on my DS: Creating a slider on the 'Parameters' tab that can ONLY have integer values thread...