Question Error loading preset appearance (does not change body?)

henshin

Member
Messages
57
Reactions
6
Points
8
My appearance presets are not loaded correctly anymore (hair and texture are loaded, but not the face, body, clothes, etc)
This is the error I get:

!> Exception during Restore of geometry: System.NullReferenceException:
at (wrapper managed-to-native) UnityEngine.MonoBehaviour:IsObjectMonoBehaviour (UnityEngine.Object)
at UnityEngine.MonoBehaviour.StartCoroutine (IEnumerator routine) [0x00000] in <filename unknown>:0
at Redeyes.DiviningCleavageAndNipples.OnToggleItem (.JSONStorableBool jsb) [0x00000] in <filename unknown>:0
at (wrapper delegate-invoke) JSONStorableBool/SetJSONBoolCallback:invoke_void__this___JSONStorableBool (JSONStorableBool)
at JSONStorableBool.InternalSetVal (Boolean b, Boolean doCallback) [0x00000] in <filename unknown>:0
at JSONStorableBool.set_val (Boolean value) [0x00000] in <filename unknown>:0
at DAZCharacterSelector.SetActiveClothingItem (.DAZClothingItem item, Boolean active, Boolean fromRestore, Boolean skipSyncAnatomy) [0x00000] in <filename unknown>:0
at DAZCharacterSelector.ResetClothing (Boolean clearAll) [0x00000] in <filename unknown>:0
at DAZCharacterSelector.RestoreFromJSON (SimpleJSON.JSONClass jc, Boolean restorePhysical, Boolean restoreAppearance, SimpleJSON.JSONArray presetAtoms, Boolean setMissingToDefault) [0x00000] in <filename unknown>:0
at MeshVR.PresetManager.Restore (SimpleJSON.JSONClass jc) [0x00000] in <filename unknown>:0

Maybe is related with some plugin?
I can see there is "DiviningCleavageAndNipples" there but I don't have active that plugin in my scene, session or female
This happens on any scene, even the ones without animations and only one female

EDIT: restarting VAM seems to solve the problem, but if somebody has any clue about what could causing this is very welcome, because is not the first time this happen
 
Last edited:
Sometimes you can reset the appearance to the default look and then load the preset that you want. It worked for me also and then I'll restart vam if it doesn't.
 
Upvote 0
Yes, the error originates from the DiviningCleavageAndNipples plugin. Since you don't have the plugin active in the scene, that's why it produces an error - the clothing item's toggle still has a callback that references code from the plugin, but the plugin has been removed so the callback produces an error.

@redeyes This can be fixed by removing the callbacks that you add to clothing items in the script's OnDestroy - example:

C#:
private List<JSONStorableBool> clothingEnabledBools;
   
private void Init()
{
    clothingEnabledBools = // ... build list of clothing bools
    foreach(var jsb in clothingEnabledBools)
    {
        jsb.setCallbackFunction += OnToggleItem;
    }
}

private void OnToggleItem()
{
    if(enabled)
    {
        this.StartCoroutine... // this is null if called when plugin is removed
    }
}
   
private void OnDestroy()
{
    foreach(var jsb in clothingEnabledBools)
    {
        jsb.setCallbackFunction -= OnToggleItem;
    }
}

EDIT: Redeyes has stated they're no longer supporting this plugin given that Naturalis has clothing profiles built in: https://hub.virtamate.com/threads/diviningcleavageandnipples.44379/page-2
 
Upvote 0
Yes, the error originates from the DiviningCleavageAndNipples plugin. Since you don't have the plugin active in the scene, that's why it produces an error - the clothing item's toggle still has a callback that references code from the plugin, but the plugin has been removed so the callback produces an error.

@redeyes This can be fixed by removing the callbacks that you add to clothing items in the script's OnDestroy - example:

C#:
private List<JSONStorableBool> clothingEnabledBools;
  
private void Init()
{
    clothingEnabledBools = // ... build list of clothing bools
    foreach(var jsb in clothingEnabledBools)
    {
        jsb.setCallbackFunction += OnToggleItem;
    }
}

private void OnToggleItem()
{
    if(enabled)
    {
        this.StartCoroutine... // this is null if called when plugin is removed
    }
}
  
private void OnDestroy()
{
    foreach(var jsb in clothingEnabledBools)
    {
        jsb.setCallbackFunction -= OnToggleItem;
    }
}

EDIT: Redeyes has stated they're no longer supporting this plugin given that Naturalis has clothing profiles built in: https://hub.virtamate.com/threads/diviningcleavageandnipples.44379/page-2
I've updated the main page to state I'm no longer supporting this plugin and directed them to naturalis
 
Upvote 0
Back
Top Bottom