Export ContentType from Daz Studio

Issue #2185 open
Midnight Arrow created an issue

I’m working on my own Python addon to automate and streamline exporting figures through Diffeomorphic. I think it’d be useful if the DBZ file exported and copied over the ContentType property from Daz Studio.

The ContentType is laid out in the official DSON specs.

The Daz manual elaborates on how the ContentType is used by Daz Studio to smartly identify what kind of asset it is dealing with.

  • Items that fit to a figure (such as Genesis, Michael 4, etc.) will be some sort of Follower because they follow the joint bends.
  • Follower/Accessory is for things that aren't found under Wardrobe (belts, earrings, necklaces, etc.).
  • Follower/Attachment is for Geo-Grafting™ (WIP) items (built to weld to the figure, such as genitalia, additional limbs, etc.).
  • Follower/Wardrobe is for the specific things listed there.
  • One of the uses of Content Type is for auto-replacement of same types of content. For instance, if a shirt is loaded, then a user decides to load another shirt, it will detect the same Content Type and offer to remove the first shirt before loading the second. Sometimes a user will need to interpret the purpose of the clothing when setting the type. For instance, a skirt is in the same place as pants, so the content type for a skirt would be Follower/Wardrobe/Pant so they would auto-replace each other.

Simply exposing this property as a string would enhance the capabilities of the addon, both for those who script (me and Thomas), and those who use the addon as it is. For instance, when transferring shape keys, it can do a string compare on the ContentType to automatically decide what kind of shape keys need to be transferred and to what, rather than rely on manually selecting them.

  • “Actor/Character” == figure
  • “Follower/Attachment” == geograft
  • “Follower/Hair” == hair
  • “Follower/Wardrobe” == clothing

And so on.

Here’s the lead programmer of Daz Studio explaining how to extract it using DazScript.

Comments (5)

  1. Alessandro Padovani

    I guess this could be useful especially for easy import, which I understand is using some heuristics instead to transfer morphs to different types.

  2. Thomas Larsson repo owner

    There shouldn’t be any need to include the content type in the dbz file, because the info should already be available in the duf file. E.g, for G8M:

    {
        "type" : "studio/element_data/simple_data",
        "name" : "CharacterPostLoadAddons",
        "settings" : {
            "PostLoadScriptPath" : "data/DAZ 3D/Genesis 8/Male/Tools/Utilities/Character Addon Loader.dse",
            "PostLoadScriptSettings" : {
                "type" : "settings",
                "value" : {
                    "PostLoadAddons" : {
                        "type" : "settings",
                        "value" : {
                            "Follower/Attachment/Head/Face/Eyelashes" : {
                                "type" : "settings",
                                "value" : {
                                    "AssetName" : "Genesis8MaleEyelashes",
                                    "AssetFile" : "data/DAZ 3D/Genesis 8/Male Eyelashes/Tools/Script Loads/Genesis 8 Male Eyelashes.duf",
                                    "Presets" : {
                                        "type" : "settings",
                                        "value" : {
                                            "Mat" : {
                                                "type" : "settings",
                                                "value" : {
                                                    "PresetFile" : "People/Genesis 8 Male/Materials/Base Materials/Iray/Base MAT Eyelashes.duf",
                                                    "SelectAddon" : false
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    

    I’m not sure what to do with this.

  3. Alessandro Padovani

    I understand "Follower/Attachment/Head/Face" tells this is a face mesh, thus to be used for “transfer to face”. Specifically “follower“ tells morphs are transferred.

  4. Midnight Arrow reporter

    I believe since this is asset-level metadata it’s usually found in DSF files, not DUF files. I’ve always located it under dson_file["node_library"][figure]["presentation"]["type"]. You can inspect this in Daz Studio with the Scene Identification popup (Go to the Outliner, hit the hamburger icon, and go down to Edit).

    Genesis 8 Female says its content type is Actor/Character.

    Daz Dog 8 says its content type is Actor.

    RawArt’s Lekkulian tentacles say their content type is Follower/Attachment/Head.

    Fugazi1968’s Mega Hoodie says its content type is Follower/Wardrobe/Outerwear/Top.

    Hypertaf’s Antique Locket says its content type is Follower/Accessory/Neck.

    The content type always seems to be a slash-delimited path, so a simple Python string split should suffice. If it’s an Actor, then it’s a figure. If it’s a Follower, it’s a rigged asset which follows the actor. Therefore morphs should be transferred from Actor to followers.

    There are four kinds of followers (besides just plain “Follower”) and they mostly correspond to a Smart Content category:

    • Follower/Accessory == “Accessories”
    • Follower/Attachment == “Anatomy” (geografts, eyebrows, eyelashes, etc.)
    • Follower/Hair == “Hair”
    • Follower/Wardrobe == “Wardrobe”

    I did say “mostly” – in some cases (like body hair), in Smart Content it’s listed in the Hair category, but the content type is still marked as “Follower/Attachment”, same as eyebrows and eyelashes. On the other hand, we have Headset for Genesis 8, which is in the Accessories category but its content type is a Prop. Which is correct – even though it has bones, it is meant to be parented to the ear and does not autofit to the figure. In both cases, the content type correctly defines whether the asset should have morphs transferred from the figure.

  5. Log in to comment