Programming Scripts
Hi,
I'm a retired computer programmer that would like to create some scripts to automate some things I do time and time again. for example:
I want to zero the poses for a hand (or other parts of a figure). I select the hand, expand from the selection, scroll down to the pinky finger), press <shift - enter>, zero the entire selection and deselect the selection. Obviously this is tedious and something that should be autometed.
Probably someone has already made a script that does this but what I want is how to write such a script myself. I believe that Java Script is used, but without the variable and function names it is an impossibile task. Can I get documentation for the variable, constant and functions. I believe I also would need the compiled object file(s) to use those functions.
PS. I am not a Java Script programmer ( I am familliar with C, Pascal, Ada, and Java) so it would be a trivial matter to learn.
Bill Stanley
Comments
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/start has the object definitions and some samples. Although Daz Script shares a common ancestry with Javascript (and Action Script, and others) it isn't exactly the same.
I have posted a script to do this in an earlier thread which you can reference. Zero Pose of Node and all children Script
The documentation Richard pointed you to has many sample scripts you should find helpful.
Daz Script 1 (DAZ Studio 3) is based on QSA which is a subset of ECMA-262 3rd edition (ECMAScript 4.0)
Daz Script 2 (DAZ Studio 4) is an extension of Qt Script which is an extension of ECMA-262 5.1st edition
DAZ 3D has stated that there will be changes to the scripting environment in DAZ Studio 5 - Daz Studio 5 development update
While I have not seen it stated, they are probably switching to QJSEngine which means ECMAScript 2015 or newer.
Did you know: chatGPT can write a simple DAZ3D sample scripts for you?
Do they work? One of its first efforts was a Python script using various libraries it had cionjured up out of thin air. I wouldn't expect much from it, especially if it wasn't easily derived from the human-written scripts from which its data was built.