Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1036

Adding CustomAction to a *.duf file via script

$
0
0

Had enough of losing custom action menu, so I wrote a script that reads a CSV file to create a Scripts menu. The script is heavily based on the example from Daz Studio here:

http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/actions/action_custom_create/start

But noticed something weird... CustomActions pointing to *.dse and *.dsa files launch from the menu. However, if the CustomAction points to a *.duf file... the custom action will be added to the menu, yet it does nothing when launched from the menu.

This can be tested by using the example above script above, and editing the variables to point to a Materials setting (using the absolute path to *.duf file, such as a Material preset):

sActionMenu = "&Scripts/Testing";
sActionToolbar = "Metal - Aluminum - Brushed";
sActionText = "Metal - Aluminum - Brushed";
sActionDesc = "Content Library - /Shader Presets\Iray/DAZ Uber/Metal - Aluminum - Brushed.duf";
sActionFilePath = "E:/DAZContent/Studio/My Library/Shader Presets\Iray/DAZ Uber/Metal - Aluminum - Brushed.duf";
sActionIconPath = "E:/DAZContent/Studio/My Library/Shader Presets\Iray/DAZ Uber/Metal - Aluminum - Brushed.png";

sActionName = createCustomAction( sActionText, sActionDesc, sActionFilePath, sActionIconPath, true );

Then, if I highlight an object, and clicking the Menu shortcut that the script created - nothing happens.

HOWEVER, if I create a CustomAction to "Metal - Aluminum - Brushed" using the right click method, it works.

Something seems different with *.duf files and inserting the CustomAction using oMenu.insertCustomAction( sAction, nIndex ); vs. *.dse/*.dsa files; or using the Right Click method.

Any ideas?


Viewing all articles
Browse latest Browse all 1036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>