Script to replace one type of content with another "DzContentReplaceMgr"

KarenKaren Posts: 82

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?

Post edited by Karen on

Comments

  • crosswindcrosswind Posts: 5,431

    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...

    SNAG-2024-1-11-0015.png
    628 x 674 - 63K
    SNAG-2024-1-11-0016.png
    2560 x 1400 - 441K
  • KarenKaren Posts: 82

    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

  • crosswindcrosswind Posts: 5,431

    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.

  • KarenKaren Posts: 82

    The dialogue in picture 0016 does not show up sad  I don't know why, maybe it does not work in Studio Beta?

  • crosswindcrosswind Posts: 5,431

    Karen said:

    The dialogue in picture 0016 does not show up sad  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.

  • KarenKaren Posts: 82

    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.

  • crosswindcrosswind Posts: 5,431
    edited January 11

    Karen said:

    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...

    Post edited by crosswind on
Sign In or Register to comment.