Scripting in DAZ Studio 2025

Hi,

Is any documentation have been released about the updates in scripting required by DAZ Studio 2025?

Comments

  • Richard HaseltineRichard Haseltine Posts: 107,857

    There is some geenral discussion in the Evergreen thread, starting here https://www.daz3d.com/forums/discussion/comment/9137811/#Comment_9137811 , but I would imagine that, like the SDk though perhaps to a lesser extent, vey little is as yet firmly locked down.

  • TugpsxTugpsx Posts: 792

    Thanks for the link Richard. That application restart script could come in handy for users weras iray is not functioning after a simulation and they could simply run the script to save current work to a temp file and restart studio with the scene resumed.

  • meipemeipe Posts: 108

    Thanks!

  • meipemeipe Posts: 108

    as a start...

    this isn't supported anymore:

    DzMaterial : doDuplicateElement( DzElementDuplicateContext context )

    replace with this:

    DzMaterial : duplicateOrDefaultMaterial( DzElementDuplicateContext context )

  • TugpsxTugpsx Posts: 792

    Yeah. Having similar issues where code was deprecated  and we are unsure what they are replaced with. We will have to wait for the updated documentation. 
     

  • Richard HaseltineRichard Haseltine Posts: 107,857
    edited April 25

    meipe said:

    as a start...

    this isn't supported anymore:

    DzMaterial : doDuplicateElement( DzElementDuplicateContext context )

    replace with this:

    DzMaterial : duplicateOrDefaultMaterial( DzElementDuplicateContext context )

    Since this is an alpha release only it would be very wise to avoid trusting any undocumented calls - there is a pretty high probability that they may change before a full General Release version (and even then undocumented calls are not guaranteed to remain the same).

    I am told that this issue is in any event fixed in the latest, not yet Public, build.

    Post edited by Richard Haseltine on
  • meipemeipe Posts: 108
    edited April 25

    I understand your point, but it sounds they are already updating some official docs.

    "duplicateOrDefaultMaterial" sounds new as it doesn't work with DAZ Studio 4.23-, and it is documented here:

    DzMaterial [Documentation Center]

    Post edited by meipe on
  • TromNekTromNek Posts: 41

    ( tell me if I should start a new thread for this )

    It seems that Qt6 (or DS6) handles certain assignments differently. As in assignment by value verses assignment by reference.

    I have a script that stores the Viewport.size then changes it temporarily then restores the original size.

    Attached is some code to demonstrate the differenence.

    dsa
    dsa
    aaShowNewQt6Behavior.dsa
    954B
  • TromNekTromNek Posts: 41

    (just saw how to insert a code snippet, here it is again)

    	// Temporary Viewport size	var tmpWidth = 1000;	var tmpHeight = 500;	tmpSize = Size( tmpWidth + 6, tmpHeight + 6 );	var vpA = MainWindow.getViewportMgr().getActiveViewport();		// Save original Viewport size so we can restore it later		// Below doesn't work in DS6	var origSize = vpA.size; // worked in Qt4, maybe it made a deep copy then assignment	// I think the new Qt6 in DS6 does a assignment by reference, so, ...	var origSize = Size( vpA.width, vpA.height); // this works in Qt6 (it's the proper way anyhow)	print("Current ViewPortSize height: " + vpA.height + " width: "+vpA.width);	print("Change it to tmpSize");	vpA.size = tmpSize;		print("Current ViewPortSize height: " + vpA.height + " width: "+vpA.width);	print("Change it back to original size");	vpA.size = origSize;	print("Current ViewPortSize height: " + vpA.height + " width: "+vpA.width);

     

     

     

  • Richard HaseltineRichard Haseltine Posts: 107,857

    I think this is an example of the Object vs Object-Like  section in https://www.daz3d.com/forums/discussion/comment/9137806/#Comment_9137806

  • TromNekTromNek Posts: 41

    I read that section and thought it might be related too. But it doesn't really get into assignment by value/copy verses assignment by reference.

    Anyway, it's good to know to be extra careful you want to save the 'state' of an object to restore later.

    thanks 

  • V3DigitimesV3Digitimes Posts: 3,365

    I'll have a look at the tip to duplicate elements, because I already fixed one in one of my scripts for 2025, and it was a super "heavy-but-robust" methods, so if it works, I'll keep it in a corner of my mind!

  • matewmatew Posts: 109

    Sometihng wrong with button icons. The worst is DAZ 2025 doesn't show any errors - it just messed up the dialog.

     

    Untitled-1.jpg
    1000 x 600 - 72K
  • matewmatew Posts: 109

    And here it's even worse. Total mess and no errors.

     

    Untitled-1.jpg
    1795 x 1111 - 213K
    Untitled-2.jpg
    1795 x 1074 - 143K
  • matewmatew Posts: 109

    Richard Haseltine said:

    See https://www.daz3d.com/forums/discussion/comment/9137801/#Comment_9137801

    Thank you. I hope "worked on in due course" means quite soon.

  • TugpsxTugpsx Posts: 792

    Turned the studio restart script into an autolaunch script with added info because Genesis8 behaves differently in Studio 2025.

    One can choose to see the info, save out for later viewing or skip the info all together. you will be prompted to save the scene and has overwrite checks.

    I have not spent much time on correcting the eyelash morph issue with G8 so users can ignore it and continue with the restart and reload of their scene,

    If scene only has g9 there was no issue with the eyelash problems.

     
     

    Screenshot 2025-07-27 121116.png
    452 x 411 - 37K
Sign In or Register to comment.