• Hi Guest!

    This is a notice regarding recent upgrades to the Hub. Over the last month, we have added several new features to improve your experience.
    You can check out the details in our official announcement!
Resource icon

Plugins Pubes Clipping Reducer

vamtaco

Active member
Messages
6
Reactions
249
Points
28
Website
www.patreon.com
vamtaco submitted a new resource:

Pubes Clipping Reducer - Prevent pubes poking through clothing.

Evaluates tags on hair and clothing to show and hide pubic hair when clothing is on/off.

Hair
When the plugin is loaded/reloaded, any hair with tag Genital is cached. When you activate/deactivate clothing managed by the plugin, any cached hair is either hidden (clothing on) or shown (clothing off).
View attachment 2074

Clothing
You must add custom tag HidePubes to any clothing that you want to be managed by the plugin.
[ATTACH...

Read more about this resource...
 
Hello,

Either I'm doing something wrong or this plugin doesn't work anymore with VaM 1.20.1.4 beta.

Settings:

pcr-screen2.jpg
pcr-screen3.jpg


Result:

pcr-screen1.jpg


and yes, I've hit the plugin reload button.

Any help appreciated.
 
It looks like the newest version of VAM forces tags to only be lowercase, so "HidePubes" becomes "hidepubes". Unfortunately the plugin doesn't seem to work right now because of this.
 
Last edited:
Need to update to support user defined tags, like a text field. Actually, i'll make one that does clothes layers and pubes... the tags are case sensitive, so having that might be helpful
 
I got it working, caSE INSenSiTIve ( .toLower() ) and found another glitch as well, where multiple items of the same name break the listq object single call as well added a few text fields you can specify your own clipping tags, so maybe if you wanted to do some layered clipping or something. Somethign similar for tight pants and underwear would be cool using the same idea too... th oughts?
 
I got it working, caSE INSenSiTIve ( .toLower() ) and found another glitch as well, where multiple items of the same name break the listq object single call as well added a few text fields you can specify your own clipping tags, so maybe if you wanted to do some layered clipping or something. Somethign similar for tight pants and underwear would be cool using the same idea too... th oughts?

I saw that the creator used to have a similar bug with their nipple clipping reducer plugin and eventually patched it. Perhaps you can find a work around in that plugin's code. Like you, I've patched this plugin for my own use. One of us should eventually release a new version for other people to use, but it sounds like you've probably put more work into yours than I ever did.
 
With the breadcrumbs from the above conversations I was able to fix this and get it working for me. I hope this is appropriate to paste here for everyone to copy/paste into their non working cs file replacing all below these lines:

```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````

using System.Collections.Generic;
using System.Linq;

namespace vamtaco
{
public class PubesClippingReducer : MVRScript
{
private DAZCharacterSelector _character;
private List<PubesNoClipClothingItem> _noClipClothingItems;
private List<string> _hiddenHairUids;

public override void Init()
{
if (containingAtom.type != "Person")
{
SuperController.LogMessage("Pubes Clipping Reducer (Disabled): This plugin is designed to be used on a person atom.");
enabled = false;
return;
}

_noClipClothingItems = new List<PubesNoClipClothingItem>();
_hiddenHairUids = new List<string>();

var geometry = containingAtom.GetStorableByID("geometry");
_character = geometry as DAZCharacterSelector;

//load supported clothing
foreach (var clothing in _character.clothingItems.Where(c => c.tagsArray.Contains("hidepubes")))
{
LoadNoClipClothingItem(clothing.displayName);
}
}

void Start()
{
//if any clothing is active, hide pubes
if (_noClipClothingItems.Any(o => o.ClothingItem.isActiveAndEnabled))
{
hidepubes();
}
}

void Update()
{
foreach (var c in _noClipClothingItems)
{
c.EvaluateStateChange();
}
}

public void OnClothingItemStateChanged(DAZClothingItem clothingItem)
{
//item is now active so hide pubes
if (clothingItem.isActiveAndEnabled)
{
var clothSimControlChildren = clothingItem.GetComponentsInChildren<ClothSimControl>();
bool anyUndressed = clothSimControlChildren.Any(o => o.clothSettings.BreakEnabled);

if (anyUndressed)
{
ShowPubes();
return;
}

hidepubes();
return;
}

ShowPubes();
}

private void hidepubes()
{
_hiddenHairUids = _character.hairItems.Where(h => h.active == true && h.tags.Contains("genital")).Select(h => h.uid).ToList();
_hiddenHairUids.ForEach(hid => _character.SetActiveHairItem(hid, false));
}

private void ShowPubes()
{
_hiddenHairUids.ForEach(hid => _character.SetActiveHairItem(hid, true));
_hiddenHairUids.Clear();
}

private void LoadNoClipClothingItem(string name)
{
var clothing = _character.clothingItems.SingleOrDefault(c => c.displayName == name);
if (clothing != null)
{
var ncci = new PubesNoClipClothingItem(clothing);
ncci.OnStateChanged += new PubesNoClipClothingItem.OnStateChangedEvent(OnClothingItemStateChanged);
_noClipClothingItems.Add(ncci);
}
}
}

public class PubesNoClipClothingItem
{
public string Name { get { return ClothingItem.displayName; } }

public DAZClothingItem ClothingItem { get; }

public delegate void OnStateChangedEvent(DAZClothingItem clothingItem);
public OnStateChangedEvent OnStateChanged;

private bool _previousState;
private bool _previousUndressState;
private ClothSimControl[] _clothSimControls;

public PubesNoClipClothingItem(DAZClothingItem clothingItem)
{
ClothingItem = clothingItem;
_previousState = clothingItem.isActiveAndEnabled;
_clothSimControls = clothingItem.GetComponentsInChildren<ClothSimControl>();
_previousUndressState = _clothSimControls.Any(o => o.clothSettings.BreakEnabled);
}

public void EvaluateStateChange()
{
if (ClothingItem == null)
return;

//clothing item state has changed
bool anyUndressed = _clothSimControls.Any(o => o.clothSettings.BreakEnabled);

if (ClothingItem.isActiveAndEnabled != _previousState
|| anyUndressed != _previousUndressState)
{
_previousState = ClothingItem.isActiveAndEnabled;
_previousUndressState = anyUndressed;
OnStateChanged?.Invoke(ClothingItem);
}
}
}
}
 
When I try the edit, i get issues. I couldn't find any typos, however Notepad++ claimed there was a bracket error
 
Anyone ever get this working? It appears that renaming "HidePubes" to "hidepubes" causes a <filenameunknown> error message within VaM now. (This workaround did work in earlier versions of VaM.)
 
It's very odd, it was working for me for about a week then just stopped and I cant get it to work again. Maybe @aawalker or another coding guru could chime in and help with the heavy lifting here.
 
I was able to get it working with code basically identical to cmramlow, except I didn't rename the HidePubes function, just the tag. I doubt that would cause any problems, though. All you really need is to replace the "HidePubes" on line 29 with "hidepubes", and the "Genital" on line 75 with "genital". There's no need to rename the HidePubes function, but that shouldn't be causing any trouble, either.

I did run into weird errors trying to editing vamtaco's original, and had to start a new plugin from scratch for some weird reason, with my own namespace. Try that?
 
Can anyone please post the working code in full for this please?
Such a valuable resource left to rot, would love its functionality back.
 
@felixback already done above.
Here is modified VAR ready to go.
Or single script file.
Darng, I appreciate you sharing, thank you.
Sadly I get the same error my own attempts resulted in, any tips?

!> Exception during plugin script Init: System.InvalidOperationException: Operation is not valid due to the current state of the object
at System.Linq.Enumerable.Single[DAZClothingItem] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.SingleOrDefault[DAZClothingItem] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
at vamtaco.PubesClippingReducer.LoadNoClipClothingItem (System.String name) [0x00000] in <filename unknown>:0
at vamtaco.PubesClippingReducer.Init () [0x00000] in <filename unknown>:0
at MVRPluginManager.CreateScriptController (.MVRPlugin mvrp, DynamicCSharp.ScriptType type) [0x00000] in <filename unknown>:0
 
Ok guys I'll share this with ZERO support since I didn't write/upgrade the code but paid a very talented coder to make this work, it was only like $30 and it finally worked with the latest VAM. I don't use it much anymore these days but can confirm it did work earlier this week upon loading an older scene with two female persons having it in their plugin stack of about 25 plugins.

This will actually do both nipple and pub hiding as I had VamWizard combine both into this one plugin.

Treat the licensing as the same from vamtaco's original plugins: https://pixeldrain.com/u/sHx4SL5Z

Mods: if I'm sharing this in error of any rules I'm unaware of please let me know
 
@felixback just downloaded the var from px link in my previous post and put it in clean VaM.
Plugin loads and works as intended w/o any errors.
Sorry, no clue how to interpret the error you get.
 
@cmramlow Thanks very much, after a fresh VAM install i manged to get your combined one working, very much obliged and delighted, thank you.

For anyone else using it, it now auto hides and hairs tagged with GENITAL, not just hidepubes.
 
Back
Top Bottom