• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

How list all morphs

henshin

Active member
Joined
Dec 29, 2023
Messages
184
Reactions
83
Hi! I'm starting to learn how to write plugins in VAM, but I couldn't find any documentation, just trying to figure out some things reading other plugins :/

Does somebody know how can I list all the female morphs? (I'm adding the plugin to the person)

I was trying this (recommended by gpt4) but I get this error:
Type DAZCharacter' does not contain a definition for morphBank' and no extension method morphBank' of type DAZCharacter' could be found

Code:
if (containingAtom == null)
            {
                SuperController.LogMessage("No atom.");
                return;
            }

            
            var characterSelector = containingAtom.GetStorableByID("geometry") as DAZCharacterSelector;
            if (characterSelector == null || characterSelector.selectedCharacter == null)
            {
                SuperController.LogMessage("no valid DAZCharacterSelector.");
                return;
            }

            
            var character = characterSelector.selectedCharacter;

            
            var morphBank = character.morphBank;
            if (morphBank == null || morphBank.morphs == null || morphBank.morphs.Count == 0)
            {
                SuperController.LogMessage("No morphs.");
                return;
            }

            
            SuperController.LogMessage($"total morphs: {morphBank.morphs.Count}");
            foreach (var morph in morphBank.morphs)
            {
                SuperController.LogMessage($"Morph: {morph.morphName}");
            }
 
morph banks exist on the DAZCharacterSelector object :)

Join the official discord, there's a lot of info on the #scripting channel including a pinned post with useful links for starting plugin developers.
 
Look at the Life plugin => Internal\MacGruber_DriverBreathing.cs => InitAnimation()

Using the GenerateDAZMorphsControlUI object you should be able to get a list of morphs via any of these:
  • List<DAZMorph> GetMorphs()
  • List<string> GetMorphDisplayNames()
  • List<string> GetMorphUids()
 
Back
Top Bottom