Question Hair part reversed

mspeck01

Well-known member
Messages
161
Reactions
389
Points
63
I'm trying to make an accurate look and most of the hair I like have the part on the wrong side.
Is there an easy setting to reverse the hair so the part is on the other side?
Sorry if this is a stupid question. I searched but couldn't find anything on this.
 
Sorry to say there is no way to do that with an existing style. It's been on the wanted list for many people for a very long time.
 
Upvote 0
The question gave me a rough idea for a Plugin:
  • create Plugin for person Atom, just add "flip hair" button
  • Button has to find all hair objects attached to this person (assumes it is a VAM style hair and not CUA based)
  • iterate over hair objects
  • invert local x axis scaling from 1 to -1
That would switch left to right and right to left. In the Unity Editor with an example palm tree it worked.

10000€ please and I'll do it :ROFLMAO:
 
Upvote 0
I'm still waiting for an easy way to convert clothing from female to male and vice versa. But that's a whole other kettle of fish...
 
Upvote 0
I have tried and failed to make the Plugin idea reality.
EDIT:
Months later ... Use localScale = new Vector3() instead of Set()! That does 'something' with the hair.

Unfortunately Unity / VAM ignores all attempts to alter the local scale.
It's always 1.0f. I don't know the reason, but it could be related to this:

https://answers.unity.com/questions/1220751/localscale-not-working-1.html
Unity intentionally doesn't let you change the value of a property you are animating.
What is happening here is you're changing the local scale value of your object, but since you're in play mode and the object is animated, it will be overwritten back to the animated value.

Here is a code snippet in case somebody wants to try:
C#:
Atom _person;    
public override void Init()
{
    try {
        _person = SuperController.singleton.GetSelectedAtom();
        if (_person.category != "People")
        {
            SuperController.LogError("SallyHairInvert must be on a Person atom.");
            return;
        }

        List<DAZHairGroup> DAZHairGroups = new List<DAZHairGroup>();
        foreach (DAZHairGroup hairGroup in _person.GetComponentsInChildren<DAZHairGroup>())
        {
            SuperController.LogMessage("SallyHairInvert DAZHairGroup: " + hairGroup.name + "  scale.x: " + hairGroup.transform.localScale.x);
            Vector3 scale = hairGroup.transform.localScale;
            //scale.x *= -1f;
            scale = new Vector3(2f, 1f, 1f);
            hairGroup.transform.localScale.Set(scale.x, scale.y, scale.z);
            SuperController.LogMessage("inverted scale.x: " + hairGroup.transform.localScale.x);
        }

        JSONStorableBool jbool = new JSONStorableBool("INVERT HAIR", false);
        UIDynamicToggle dToggleInvertHair = CreateToggle(jbool, false);
        //jbool.setCallbackFunction += ToggleInvertHair;
    }
    catch (Exception e) {SuperController.LogError("Exception caught: " + e);}
}
 
Last edited:
Upvote 0
I have tried and failed to make the Plugin idea reality.
EDIT:
Months later ... Use localScale = new Vector3() instead of Set()! That does 'something' with the hair.

Unfortunately Unity / VAM ignores all attempts to alter the local scale.
It's always 1.0f. I don't know the reason, but it could be related to this:

https://answers.unity.com/questions/1220751/localscale-not-working-1.html


Here is a code snippet in case somebody wants to try:
C#:
Atom _person;   
public override void Init()
{
    try {
        _person = SuperController.singleton.GetSelectedAtom();
        if (_person.category != "People")
        {
            SuperController.LogError("SallyHairInvert must be on a Person atom.");
            return;
        }

        List<DAZHairGroup> DAZHairGroups = new List<DAZHairGroup>();
        foreach (DAZHairGroup hairGroup in _person.GetComponentsInChildren<DAZHairGroup>())
        {
            SuperController.LogMessage("SallyHairInvert DAZHairGroup: " + hairGroup.name + "  scale.x: " + hairGroup.transform.localScale.x);
            Vector3 scale = hairGroup.transform.localScale;
            //scale.x *= -1f;
            scale = new Vector3(2f, 1f, 1f);
            hairGroup.transform.localScale.Set(scale.x, scale.y, scale.z);
            SuperController.LogMessage("inverted scale.x: " + hairGroup.transform.localScale.x);
        }

        JSONStorableBool jbool = new JSONStorableBool("INVERT HAIR", false);
        UIDynamicToggle dToggleInvertHair = CreateToggle(jbool, false);
        //jbool.setCallbackFunction += ToggleInvertHair;
    }
    catch (Exception e) {SuperController.LogError("Exception caught: " + e);}
}
did you guys ever get anywhere with this?

It seems like a BASIC feature that Meshed should have added to the main feature set.
There are so many hairstyles that might just want flipped
 
Upvote 0
Back
Top Bottom