Anybody fancy doing a (freebie) DAZ Script version of Easypose ?

3dcheapskate3dcheapskate Posts: 2,719

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:

  1. Does DAZScript have the necessary API callsto do this ?
  2. If so,then does anybody fancy giving it a go ? I don't.
  3. (or perhaps mCasual has already done this ?)
Post edited by 3dcheapskate on

Comments

  • Rob has several sample scripts relevant to this:

    Pose the figure and then use the "Action Trigger" sample (http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/actions/action_trigger/start) to launch the "ERC Freeze..." action. If you don't know the classname of an action (this one happens to be "DzERCFreezeAction"), you can use the "Find Action Classname" sample (http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/actions/action_find_classname/start) to help you figure it out.

    ---

    If you want to control the ERC Freeze utility without showing a dialog, take a look at the "ERC Freeze" sample (http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/properties/erc_freeze/start)

    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

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited August 2018

    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...

    Post edited by 3dcheapskate on
  • 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:

    function AddERCLink ( figure , hostPart , slaveChannel , type , controlPart , masterChannel , multiplier ) {        // Get the node which has the master control on it    var controlNode = null;    if ( controlPart == "BODY" )	controlNode = figure;    else	controlNode = figure.findNodeChild( controlPart, true );        // Get the node which has the target control on it    var controlledNode = null;    if ( hostPart == "BODY" )	controlledNode = figure;    else	controlledNode = figure.findNodeChild( hostPart, true );        if ( controlNode && controlledNode ) {	// Get the master control	var masterProperty = null;	masterProperty = findMorphProperty( controlNode , masterChannel );    	// Get the slave control	var slaveProperty = null;	slaveProperty = findMorphProperty( controlledNode , slaveChannel );		if ( masterProperty && slaveProperty ) {	    var ERCLink = new DzERCLink( type , masterProperty , multiplier , 0 );	    if ( ERCLink )		slaveProperty.insertController( ERCLink );	}    }}

     

  • djigneodjigneo Posts: 283

    @3dcheapskate, can you give a brief description of what EasyPose does?

    Just add a slider bar for the figure's current pose?

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited August 2018
    djigneo said:

    @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?)

    Post edited by 3dcheapskate on
  • Don't forget that DS allows multi-selection, so there's less need for EasyPose-type controls - though they still add convenience.

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited August 2018

    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 ?

     

    Post edited by 3dcheapskate on
  • SickleYieldSickleYield Posts: 7,634
    Mine do not. EasyPose is unnecessary in Studio, because Daz Studio's ERC Freeze through the Property Hierarchy does the same thing, but easier. At least, that's my very biased opinion. I used EasyPose back when I still made Poser content and I find making ERC frozen controls vastly easier than using it ever was (even more so when you get to the longest bone chains with more than a hundred segments). It goes: pose item, right-click in Property Hierarchy, ERC Freeze, Create New, give it a name, accept, accept.
  • 3dcheapskate3dcheapskate Posts: 2,719
    edited August 2018

    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.  smiley

    (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 ! wink)

     

    Post edited by 3dcheapskate on
  • SickleYieldSickleYield Posts: 7,634
    edited August 2018
    Great! I also help out via PM here or on my deviantart if you or they should need help navigating the property hierarchy stuff. At this point I think only Daz_Josh and maybe Rawart3D know it better than I do with the sheer number of long-chain rigs I end up making.
    Post edited by SickleYield on
  • 3dcheapskate3dcheapskate Posts: 2,719
    edited August 2018

    yes 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... laugh

    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,719
    edited August 2018

    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)") ?

     

    ercfreeze2.jpg
    1498 x 1040 - 269K
    Post edited by 3dcheapskate on
  • After years of hand jamming code I discovered easypose. I loved easypose, but like you said it doesn't work on daz native files. I just got turned on to the ERC freeze in daz studio and it's just as good once you get the hang of it. Highly recommend sickleyealds character maker tutorial
  • 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.

  • 3dcheapskate3dcheapskate Posts: 2,719
    After years of hand jamming code I discovered easypose. I loved easypose, but like you said it doesn't work on daz native files. I just got turned on to the ERC freeze in daz studio and it's just as good once you get the hang of it. Highly recommend sickleyealds character maker tutorial

    Link ? smiley

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited August 2018

    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.

    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

     

    froptions.jpg
    1501 x 1043 - 257K
    froptions2.jpg
    1194 x 1036 - 236K
    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,719
    edited August 2018

    Okay, I just found it (my XROT ALL slider - under 'Display' on the Parameters tab) - and it seems to work as expected smileyyes

    Also found the one I tried to add to the root node, so that did work.

    xrotall.jpg
    1494 x 1039 - 183K
    Post edited by 3dcheapskate on
  • Video Tutorial on the subject.
  • 3dcheapskate3dcheapskate Posts: 2,719

    @Dimorphic - A belated thank you for the tutorial link yes

    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... wink

Sign In or Register to comment.