Script to replace one type of content with another "DzContentReplaceMgr"
Hello,
does anyone know about this script "DzContentReplaceMgr"
I wondered if there is a possibity to replace one wearable by another when loaded into a scene and so I did a websearch for a script or prompt or whatever and found this: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/contentreplacemgr_dz
: ContentReplaceMode
Replacment methods when loading content.
-
ALWAYS_REPLACE - When a piece of content of a specific type is loaded, any content already in the scene of the same type is removed so that the new item replaces the old one.
-
ASK_TO_REPLACE - When a piece of content is loaded, a dialog prompts the user to choose which (if any) items already in the scene should be removed.
-
NEVER_REPLACE - Items already in the scene are never removed when loading a piece of content.
-
ASK_WHEN_MATCHING - When a piece of content is loaded, a dialog prompts the user to choose which (if any) items already in the scene should be removed if there is an item of matching content type.
As far as I understand, there is a script but I can't find it. Does anyone have an idea or more insight in this?
Comments
Oh... docs.daz3d.com seems down... I could not open the link. However, AFAIK, you don't have to use a Script for this function as there's the default function set by DS in F2 - Content tab. You set the option you want there.
When you load an item of the same Content Type, the Replacement Manager will pop up.
I don't know if there's a sample code of this function but I believe a Script could be written... only it's not really necesary since this function is already there...
Oh thanks, I will try that :-)
I also thought, that the possibility, to save this replace function with a wearable would come in very handy. For example: I rigged a headdress and two or three different kind of "dangles" as wearables. And if I load one of it into the scene it would be nice, to be asked, if I want to replace the present one by the new one.
The website was down, now it seems to work again: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/contentreplacemgr_dz
Yea, the link is back. I can see all the necessary methods / properties etc. were provided with DzContentReplaceMgr and DzContentMgr... but there seems no sample code.
Certainly you can write a Script by referring to these syntax I believe... only that'll require Scripting knowledge and take some time. As an alternative, you may just save a series of Werable Presets, that'll be much much easier.
The dialogue in picture 0016 does not show up I don't know why, maybe it does not work in Studio Beta?
I checked it with latest Public Build 4.22.1.54, it works. Don't select anything in Scene pane before loading items.
Thank a lot for your help. The Replace Manager works for some clothes and ignores others. I have to find out, why. Maybe some Meta Data is missing.
You're definitely right. There're lots of Wearables having wrong metadata, esp. Content Types. Pls check their Scene Identifications...