Export joint limits?

I'm setting up a G8 figure for ragdoll simulation in Houdini, and I'd love if there were an easy way to get all the joint limits exported from DS in a text format so I don't have to click through each joint, move the slider to its min and max positions, then type those numbers into Houdini. Is there a way to do this? Preferably a way that doesn't require me to sift through an entire FBX or whatnot in a text editor?

Comments

  • TheMysteryIsThePointTheMysteryIsThePoint Posts: 2,948
    edited January 2023

    // DAZ Studio version 4.21.0.5 filetype DAZ Script

    function process( n ) {
        
        rc = n.getXRotControl()
        xmin = rc.getMin()
        xmax = rc.getMax()
        
        rc = n.getYRotControl()
        ymin = rc.getMin()
        ymax = rc.getMax()
        
        rc = n.getZRotControl()
        zmin = rc.getMin()
        zmax = rc.getMax()
        
        print ( "\"" + n.getLabel() + "\"", xmin, xmax, ymin, ymax, zmin, zmax )
        
        n.getNodeChildren().forEach( process );
        
    }

    n = Scene.getPrimarySelection()

    if (n) {

        root = n.findNodeChildByLabel( "Hip" )

        if ( root ) {

            process( root )

        } else {

            print ( "wtf... it seems like you don't have a figure selected" )

        }

    } else {

        print ( "no selection" )

    }

    Post edited by TheMysteryIsThePoint on
  • GordigGordig Posts: 10,062

    Hot, thanks. Is there a way to exclude the face rig?

  • TheMysteryIsThePointTheMysteryIsThePoint Posts: 2,948
    edited January 2023

    // DAZ Studio version 4.21.0.5 filetype DAZ Script

    // No Set container type in this version of ECMAScript?
    // Adjust this array to determine where the recursion stops.
    // Members of this array will be themselves processed, but
    // their children will not.
    var stop  = Array( "Head", "Left Hand", "Right Hand", "Left Toes", "Right Toes" )

    function process( n ) {
        
        rc = n.getXRotControl()
        xmin = rc.getMin()
        xmax = rc.getMax()
        
        rc = n.getYRotControl()
        ymin = rc.getMin()
        ymax = rc.getMax()
        
        rc = n.getZRotControl()
        zmin = rc.getMin()
        zmax = rc.getMax()
        
        print ( "\"" + n.getLabel() + "\"", xmin, xmax, ymin, ymax, zmin, zmax )
        
        label = n.getLabel()
        if ( stop.indexOf( label ) == -1 ) n.getNodeChildren().forEach( process );
        
    }

    n = Scene.getPrimarySelection()

    if (n) {

        root = n.findNodeChildByLabel( "Hip" )

        if ( root ) {

            process( root )

        } else {

            print ( "wtf... it seems like you don't have a figure selected" )

        }

    } else {

        print ( "no selection" )

    }

    Post edited by TheMysteryIsThePoint on
Sign In or Register to comment.