Digital Art Zone

 
     
DAZ Script reference for DS4.5?
Posted: 15 October 2012 10:02 AM   [ Ignore ]   [ # 3 ]
Addict
Avatar
RankRankRankRank
Total Posts:  6942
Joined  2005-08-15

Well, if it is not in the new SDK for DS 4.5, I have no idea where it would be.

http://www.daz3d.com/shop/daz-studio-4-5-sdk

Profile
 
 
Posted: 15 October 2012 05:24 PM   [ Ignore ]   [ # 4 ]
Active Member
RankRank
Total Posts:  901
Joined  2009-12-07

Hi Jimmy

Thank you. I have the SDK installed but it doesn’t contain any information (that I can find) on the new API’s or objects - all I’ve got is my DS3 DAZ Script Reference guide, and the wiki reference guide is still like a desert landscape with the water squeezed out.

Just looking for a way to find out what new objects are available in DS4.5, specifically for saving out a pose preset in DUF format.

 Signature 

PoseMaster for DAZ Studio and PoseMaster People Pack now sold at Rendo.

Profile
 
 
Posted: 15 October 2012 09:05 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRank
Total Posts:  370
Joined  2003-10-09

Perhaps you’ll remember your “How can I enumerate DzFileIOSettings?” thread in the old Developer Discussion forum. If you re-read my posts in that thread, you’ll notice in the latter two I mention posting samples using DzAssetIOFilter subclasses. Those samples have been posted for a while (since at least May 7, 2012 according to the log)... in the “desert landscape with the water squeezed out” you refer to. Perhaps you’ll find this post of use as well.

-Rob

 Signature 

- Documentation Center
- Install Manager
- DAZ Studio 4.x
- DSON Importer
- DSON File Format Specification

Profile
 
 
Posted: 16 October 2012 06:18 AM   [ Ignore ]   [ # 6 ]
Active Member
RankRank
Total Posts:  901
Joined  2009-12-07
rbtwhiz - 15 October 2012 09:05 PM

Perhaps you’ll remember your “How can I enumerate DzFileIOSettings?” thread in the old Developer Discussion forum. If you re-read my posts in that thread, you’ll notice in the latter two I mention posting samples using DzAssetIOFilter subclasses. Those samples have been posted for a while (since at least May 7, 2012 according to the log)... in the “desert landscape with the water squeezed out” you refer to. Perhaps you’ll find this post of use as well.

-Rob


Hi Rob, yes I remember the post but I didn’t think to look back there for links. I found my way to the Scripting reference and looked through but the only thing that looked usable was what looked to be the “old” DS3 object index (I suspect this is being ported over). I’ll admit I didn’t venture as far as the samples, given I was looking for reference documentation (object index, member variables and functions etc.). So thank you for the link - at a glance those sample look to be exactly what I was looking for.

On a side note: my comment about the desert landscape was intended to be humorous tongue-in-cheek. I’m fully aware there’s a one-man army behind the scripting documentation, so I hadn’t meant any offence. Hope you don’t take it the wrong way.

I’ll shout in here if I get stuck on the samples.

Thanks

 Signature 

PoseMaster for DAZ Studio and PoseMaster People Pack now sold at Rendo.

Profile
 
 
Posted: 18 October 2012 04:42 AM   [ Ignore ]   [ # 7 ]
Active Member
RankRank
Total Posts:  901
Joined  2009-12-07

Thanks to Rob’s samples I’ve managed to fully automatically save out a DUF pose preset.

There’s only 1 issue - I want to save out only the modified node transform controls. When I use the dialog, I can choose Uncheck All and Check Modified to do this, but when automating the process (without dialog), I need to run through all the nodes and check which have been modified. Only I don’t know how to do that.

In the DAZ Script 3 reference, I’ve found something that might help. If I do the following, will that tell me if the node’s control has been modified?

if (node.getXPosControl().getValue() != node.getXPosControl().getDefault())
                     
// node modified - add to DzPoseAssetIO properties 

Is that what the getDefaut() will do for me? (Of course I’d need to do the above check for every transform control: Pos, Rot, Scale).

Thanks

 Signature 

PoseMaster for DAZ Studio and PoseMaster People Pack now sold at Rendo.

Profile
 
 
Posted: 18 October 2012 07:02 AM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  15264
Joined  2003-10-09

getDefaultValue() is the function, but it seems to work yes.

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 18 October 2012 08:56 AM   [ Ignore ]   [ # 9 ]
Active Member
RankRank
Total Posts:  901
Joined  2009-12-07

Hi Richard

Indeed, getDefaultValue() it is. Sorry about the typo. Thank you for confirming.

Next question for the eleven wise men (we’re going to need them for this one) :

When saving out a pose preset in DUF format (DS 4.5), the root node (i.e. the figure) is not named, whereas all the bones are. See below.

{
 
"url" "name://@selection/lToe:?rotation/x/value",
 
"keys" [ [ 0, -74 ] ]
}
,
{
 
"url" "name://@selection:?translation/x/value",
 
"keys" [ [ 0, -88.68524 ] ]
}


As you can see above, lToe is named but Genesis is not (there is no node name). Is this an intentional part of the DUF spec or is it a bug?

 Signature 

PoseMaster for DAZ Studio and PoseMaster People Pack now sold at Rendo.

Profile
 
 
Posted: 18 October 2012 11:29 AM   [ Ignore ]   [ # 10 ]
Administrator
Avatar
RankRank
Total Posts:  370
Joined  2003-10-09

@selection will resolve to the root node (skeleton/prop) of the selected object(s) in the scene… Selecting a bone of a figure resolves to the root node (skeleton) of that figure. Selecting a non-figure owned node resolves to that node - regardless of whether it is parented to something else. @selection/lToe will resolve to the first node in the hierarchy of the selected object(s) in the scene that is named lToe... including any parented objects - the exception being nodes belonging to a figure that is parented to a node belonging to a figure. It is also important to understand that the first node in the hierarchy of a selected object is itself.

-Rob

 Signature 

- Documentation Center
- Install Manager
- DAZ Studio 4.x
- DSON Importer
- DSON File Format Specification

Profile
 
 
Posted: 22 October 2012 06:45 PM   [ Ignore ]   [ # 11 ]
Active Member
RankRank
Total Posts:  901
Joined  2009-12-07

Rob, Richard

Thank you both for your inputs above. With that you’ve helped me successfully save out pose presets fully automatically without the popup dialog box. All’s working fine now so thanks to your help.

There remains one final question which I haven’t been able to answer from the samples page, and unfortunately the API documentation for DzAssetIOMgr is not available yet. After I’ve saved out a DUF pose preset, how do I load this with DAZ Script? I have been using DzScript.loadFromFile to load DS scripts, but it doesn’t work for DUF files, and neither does App.getImportMgr().readFile().

Which method should I used to load/import a DUF pose preset?

Thanks

 Signature 

PoseMaster for DAZ Studio and PoseMaster People Pack now sold at Rendo.

Profile
 
 
Posted: 22 October 2012 07:36 PM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRank
Total Posts:  370
Joined  2003-10-09
App.getContentMgr().openFile( sPathToFilebMerge )

-Rob

 Signature 

- Documentation Center
- Install Manager
- DAZ Studio 4.x
- DSON Importer
- DSON File Format Specification

Profile
 
 
Posted: 23 October 2012 11:35 AM   [ Ignore ]   [ # 13 ]
Active Member
RankRank
Total Posts:  901
Joined  2009-12-07
rbtwhiz - 22 October 2012 07:36 PM
App.getContentMgr().openFilesPathToFilebMerge )

-Rob


Awesome, thanks Rob. In fact that line is so smart it loads everything. I had a nasty hacky if then else if then else statement going on up to now. My code has come out quite a bit cleaner from this one.

Thanks

 Signature 

PoseMaster for DAZ Studio and PoseMaster People Pack now sold at Rendo.

Profile