Forum: DAZ|Studio


Subject: DS3: Correcting file/pathnames in self-generated Material/Shader Preset scripts

3dcheapskate opened this issue on Feb 19, 2012 · 2 posts


3dcheapskate posted Sun, 19 February 2012 at 1:48 AM

How can I correct the pathnames in the .dsa material/shader presets I've created from within DS3 so that they'll work on other machines? This is the sort of thing I mean (from my Scale01.dsa shader preset):

...
DSsActions.prototype.setMaterialProperties = function( oMaterial, oShape ){
    ...
    g_oPresetHelper.setColorProperty( "Diffuse Color",  [ 255, 255, 255 ],
        "E:/Dev/Runtime/Textures/3DCheapskate/Armour/Scale01/Scale01.png" );

Obviously nobody else has their textures in the same place as mine, so I just want to make these paths generic.

In the Poser mt5/mc6 files it was simply a case of replacing the absolute pathnames that Poser created (e.g. "E:DevRuntimeTextures3DCheapskateArmourScale01Scale01.png") with Poser paths (":Runtime:Textures:3DCheapskate:Armour:Scale01:Scale01.png").

Can I do something similar here for DS?


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



3dcheapskate posted Sun, 19 February 2012 at 2:19 AM

Just answered my own question!

Found the answer here http://forum.daz3d.com/viewtopic.php?t=67234

I had the textures in a temporary folder on my desktop, and since this isn't a mapped content folders DS uses the absolute path. I simply moved the textures to a mapped content folder and regenerated the shader preset - DS now uses a relative path.

...
DsActions.prototype.setMaterialProperties = function( oMaterial, oShape ){
    ...
    g_oPresetHelper.setColorProperty( "Diffuse Color",  [ 255, 255, 255 ],
        "/Runtime/Textures/3DCheapskate/Armour/Scale01/Scale01.png" );

 

Problem solved! And quite logical too!


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).