Question about DB_List_Products_Used and save in DS

TotteTotte Posts: 13,960

I have an interesting observation that I cannot figure out if it is a bug somewhere, or that this is "how it should work".

I've been looking and playing with Robs Sample Script DB_List_Products_Used

// Source: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/metadata/list_products_used/start

And it took me a while to realize that if you add products to a scene, the script nicely generate useful information, like:

{    "node": "Box2",    "products": {        "f70ac07a-1fd3-4ffc-aca9-ff5a1297b1a4": {            "title": "New Colony",            "files": [                "/Environments/Architecture/New colony/Materials/Iray/NC Box2.duf"            ]        }    }}{    "node": "Michael 8",    "products": {        "784cd38f-9da6-40e2-bd5f-2b0bef8a2208": {            "title": "Michael 8",            "files": [                "/People/Genesis 8 Male/Characters/Michael 8.duf"            ]        },        "5a680fc4-3284-4ba0-918e-d2f541e5827b": {            "title": "Michael 8 Pre-Release PA Build",            "files": [                "/People/Genesis 8 Male/Characters/Michael 8.duf"            ]        }    }}

But as soon as I hit save in DS, it comes out like this, or runs on an opened saved file:

{	"node": "Box2",	"products": {}}{	"node": "Michael 8",	"products": {}}

Is there something I can do ( I really want to expand this script, I have some very good ideas where to take it) to get that information "back", or is it lost as soon as the scene is saved?
 

Post edited by Totte on

Comments

  • Rob is working on an update to this script, so it may be worth waiting to see what that brings - it wouldn't really be productive to go back to adjust this version in the meantime.

  • TotteTotte Posts: 13,960

    Rob is working on an update to this script, so it may be worth waiting to see what that brings - it wouldn't really be productive to go back to adjust this version in the meantime.

    Ah, thanks for the heads up!

    (and then the low flying dragon bit his head off)

  • Rob is working on an update to this script, so it may be worth waiting to see what that brings - it wouldn't really be productive to go back to adjust this version in the meantime.

    The update has now been posted.

  • TotteTotte Posts: 13,960

    Rob is working on an update to this script, so it may be worth waiting to see what that brings - it wouldn't really be productive to go back to adjust this version in the meantime.

    The update has now been posted.

    Thanks!  
    Will take a look!

     

  • barbultbarbult Posts: 24,243

    I don't see any way to tell when a script sample has been updated. Is there any date or version info in them? Is there any change log for them some place?

  • In this case Rob flagged the thread to let me know.

  • TotteTotte Posts: 13,960
    edited February 2019

    Is this a sign of a CMS in a state of slow  composting?
    I had to upload as PDF as the Cloudflare built in protection blocks you if you use SQL statements in a post



     

    pdf
    pdf
    pfdlog.pdf
    21K
    Post edited by Totte on
  • Looks like it doesn't like the syntax, or it was passed an empty string.

  • TotteTotte Posts: 13,960

    Looks like it doesn't like the syntax, or it was passed an empty string.

    That was Robs new script ran unchanged on a scene with some items in. I ran it on a single item and it worked though. The scene with many items was a RRRR scene so it contains lot's of weird stuff. 

    And the error comes from this part:

     

    		// Get the list of product GUIDs		var aGuids = getKeys( s_oProductsMap );		// Iterate over the list of GUIDs		for( var i = 0, nGuids = aGuids.length; i < nGuids; i += 1 ){			// Get the 'current' GUID			sGuid = aGuids[ i ];						// Get the product for the GUID			oProduct = oAssetMgr.findProductByGuid( sGuid );						// Initialize; capture the title			oProductInfo = { "title" : oProduct.title };						//If we are unifying the results			if( bUnified ){				// Capture the product GUID				oProductInfo[ "guid" ] = sGuid;			}						// Get the list of paths			aPaths = s_oProductsMap[ sGuid ];			// Sort and remove duplicates			aPaths = aPaths.sort().filter(				function( sValue, nIdx, aList ){					return !nIdx || sValue != aList[ nIdx - 1 ];				});						// Capture the paths			oProductInfo[ "files" ] = aPaths;						// Capture the product info			oProducts[ sGuid ] = oProductInfo;		}		

     

Sign In or Register to comment.