• Hello Guest!

    We have recently updated our Site Policies regarding the use of Non Commercial content within Paid Content posts. Please read the new policy here.

    An offical announcement about this new policy can be read on our Discord.

    ~The VaMHub Moderation Team
  • Hello Guest!

    We posted an announcment regarding upcoming changes to Paid Content submissions.

    Please see this thread for more information.

[Experimental] Xray Body

Plugins [Experimental] Xray Body 7

Stopper

Well-known member
Featured Contributor
Messages
288
Reactions
3,348
Points
93
Stopper submitted a new resource:

[Experimental] Xray Body - Render select body textures on top of all others

Disclaimer: This is still a work in progress and is still pretty rough. May mess up your character textures.

This plugin allows rendering of selected body parts on top of all other textures in the scene. Can be used to achieve an x-ray like effect.

At a high level, it works by stacking an extra camera on the scene that renders above the main camera. The internal mechanics are fairly sketchy and I'm surprised it works at all.

Known issues:
  • Enabling a new body part will...

Read more about this resource...
 
Please make this work with the default VaM dildo atom... 🙏

A naive version of this is pretty straightforward...

1684171806308.png


One caveat... You may have noticed that the original bodypart still renders underneath the overlay. I.e. the portions that aren't obstructed aren't transparent. In order to do this I needed to render the same mesh with multiple materials, which wasn't straightforward due to how VAM's shaders work.

I didn't bother doing that for non-person objects for now. This means that the entire object will be semi-transparent. The material editor will also not work. I might try fix it later.
 
Stopper updated [Experimental] Xray Body with a new update entry:

Basic support for Toys and CUAs

Added some basic support for Toys and unity assets. In theory, it should work on anything with a default Renderer.
View attachment 245303
Some caveats:
  • Unlike for people, this doesn't create separate materials for the overlay and just moves the whole object into the overlay camera.
  • No material controls, i.e. no way to make something transparent that wasn't before (except toys which have material controls)
    • Might figure this out later if people ask for it...

Read the rest of this update entry...
 
Any guide to how to use it? Should i use it on person atom or what? When i tried to load it on person atom i got this error.

!> Exception during RestoreFromLast of plugin#0_Stopper.XrayBody: System.InvalidCastException: Cannot cast from source type to destination type.
at Stopper.XrayBody.RestoreFromJSON (SimpleJSON.JSONClass jc, Boolean restorePhysical, Boolean restoreAppearance, SimpleJSON.JSONArray presetAtoms, Boolean setMissingToDefault) [0x00000] in <filename unknown>:0
at Atom.RestoreFromLast (.JSONStorable js) [0x00000] in <filename unknown>:0
 
Any guide to how to use it? Should i use it on person atom or what? When i tried to load it on person atom i got this error.

!> Exception during RestoreFromLast of plugin#0_Stopper.XrayBody: System.InvalidCastException: Cannot cast from source type to destination type.
at Stopper.XrayBody.RestoreFromJSON (SimpleJSON.JSONClass jc, Boolean restorePhysical, Boolean restoreAppearance, SimpleJSON.JSONArray presetAtoms, Boolean setMissingToDefault) [0x00000] in <filename unknown>:0
at Atom.RestoreFromLast (.JSONStorable js) [0x00000] in <filename unknown>:0

Yeah, you just load it on a person, toy, or CUA. The error's in the logic for loading in a saved scene. Did you have it enabled on a non-person atom by chance? I might not have tested that with saved scenes. Otherwise I might have broken save and restore.
 
Last edited:
Yeah, you just load it on a person, toy, or CUA. The error's in the logic for loading in a saved scene. Did you have it enabled on a non-person atom by chance? I might not have tested that with saved scenes. Otherwise I might have broken save and restore.


Which person? female or male? can you be more specific? this is what i'm doing.

1. loading any scene.
2. Loading this plugin for male.
3. error shows up.
4. reloading plugin.
5. plugins shows. i click on every thing. uncheck and check, nothing happens?
 
Which person? female or male? can you be more specific? this is what i'm doing.

1. loading any scene.
2. Loading this plugin for male.
3. error shows up.
4. reloading plugin.
5. plugins shows. i click on every thing. uncheck and check, nothing happens?

I think I might have found your issue. To create the material options UI I copied an existing material options ui, specifically the one for female eyelashes. These don't get loaded for males so the script would fail for a male-only scene (or maybe one where the male is loaded first).

While testing this out, I found a deeper issue where the UI for males and females might not have been loaded at all yet when this plugin initializes (happens when loading a scene with this plugin enabled). Bleh, I guess I'll have to refactor the initialization code...

I'll make a patch later today. Thanks for the feedback!
 
Stopper updated [Experimental] Xray Body with a new update entry:

Fixes for initialization and loading

As MerGe pointed out, plugin previously didn't load properly in some circumstances.
  • Script previously used the material options UI for female eyelashes as the general template. This caused a failure if no female models were loaded prior to initialization.
  • Similar to above, character UI aren't loaded until opened, so loading from scene failed on the first scene loaded.
At least these two issues appear to be fixed. There might be others. Let me...

Read the rest of this update entry...
 
Which person? female or male? can you be more specific? this is what i'm doing.

1. loading any scene.
2. Loading this plugin for male.
3. error shows up.
4. reloading plugin.
5. plugins shows. i click on every thing. uncheck and check, nothing happens?

Uploaded a patch. Let me know if it fixes your issues.
 
Uploaded a patch. Let me know if it fixes your issues.

It didn't fix the issue. Still getting this issue after loading it into male.


!> Exception during RestoreFromLast of plugin#0_Stopper.XrayBody: System.InvalidCastException: Cannot cast from source type to destination type.
at Stopper.XrayBody.RestoreFromJSON (SimpleJSON.JSONClass jc, Boolean restorePhysical, Boolean restoreAppearance, SimpleJSON.JSONArray presetAtoms, Boolean setMissingToDefault) [0x00000] in <filename unknown>:0
at Atom.RestoreFromLast (.JSONStorable js) [0x00000] in <filename unknown>:0

Then i reload it and then checked genitalia and other genitalia too but nothing happens? Can you TELL me how to actually use this?

All i have to do is check or uncheck body parts right? So if i check it it should render on top of everything right?
 
It didn't fix the issue. Still getting this issue after loading it into male.


!> Exception during RestoreFromLast of plugin#0_Stopper.XrayBody: System.InvalidCastException: Cannot cast from source type to destination type.
at Stopper.XrayBody.RestoreFromJSON (SimpleJSON.JSONClass jc, Boolean restorePhysical, Boolean restoreAppearance, SimpleJSON.JSONArray presetAtoms, Boolean setMissingToDefault) [0x00000] in <filename unknown>:0
at Atom.RestoreFromLast (.JSONStorable js) [0x00000] in <filename unknown>:0

Then i reload it and then checked genitalia and other genitalia too but nothing happens? Can you TELL me how to actually use this?

All i have to do is check or uncheck body parts right? So if i check it it should render on top of everything right?

Yeah, loading it on a model and checking a particular body part will render it as an overlay. I doubt you're using it wrong.

I'm not sure what it might be. Possibly a version mismatch or conflicts with other plugins? There's only one place in the failing function where I do an unchecked cast, so I can add some additional logging there.

Edit: Try the attached version, I've added a check around where the error likely is.
 

Attachments

  • Stopper.XrayBody.5.var
    4.4 KB · Views: 0
Last edited:
(I am using google translate)

i have a problem.
The position of the transparent body parts is not displayed correctly.

I am using VR.
Both men and women load this plug-in and check only "Face".
When I move, the transparent parts also move in strange directions.

image 1 (before)image 2 (after)
20230520211242_1.jpg20230520211251_1.jpg


If I move rightward from the position of image 1, the view moves to the position of image 2.
On the other hand, the transparent face moves closer to the player.

I'm wondering if the reference position for displaying transparent parts is normal.
 
(I am using google translate)

i have a problem.
The position of the transparent body parts is not displayed correctly.

I am using VR.
Both men and women load this plug-in and check only "Face".
When I move, the transparent parts also move in strange directions.

If I move rightward from the position of image 1, the view moves to the position of image 2.
On the other hand, the transparent face moves closer to the player.

I'm wondering if the reference position for displaying transparent parts is normal.

Slightly terrifying...

The plugin works by creating a second camera in the scene. It's copied off of the main camera, and is attached to the same parent so it should follow it around. It looks like somehow the two are getting out of sync, or something to that effect.

I'll see if I can reproduce it, but unfortunately I don't have a VR set. Do you get the same issue in desktop mode?
 
I can confirm that this happen also to me... (tried on a dildo atom).
Quest 2 headset.
 
I can confirm that this happen also to me... (tried on a dildo atom).
Quest 2 headset.

Thanks for confirming. Does it look like the overlay is rendered from the 'default' camera position regardless of where you move?

If that's the case then the overlay camera isn't following the VR camera correctly. It's configured to follow Unity's main camera for the scene, but it's possible VR doesn't use that.

Even if I'm right about the cause, it's going to be hard for me to fix without reproducing locally... Maybe I should just get a headset. I hear they're neat.
 
Stopper updated [Experimental] Xray Body with a new update entry:

Fixes for custom textures. Added base camera selection (for VR)

  • Fixed saving and loading of custom textures (third tab of material options)
  • Added an alpha mask for female genitalia that omits most of the pelvis.
    • Needs to be set manually
  • Fixed issue where I was actually rendering each texture twice (once in the overlay camera and once on the main camera). No more z-fighting!
  • Added camera selection. This was primarily to help VR users, for whom the main camera...

Read the rest of this update entry...
 
(I am using google translate)

i have a problem.
The position of the transparent body parts is not displayed correctly.

I am using VR.
Both men and women load this plug-in and check only "Face".
When I move, the transparent parts also move in strange directions.

If I move rightward from the position of image 1, the view moves to the position of image 2.
On the other hand, the transparent face moves closer to the player.

I'm wondering if the reference position for displaying transparent parts is normal.

I can confirm that this happen also to me... (tried on a dildo atom).
Quest 2 headset.

I don't know if this'll fix it, but I added a camera selection option to the UI. My theory is that if you select the right camera then it aught to work.

Can I ask either of you to try all of the cameras you have in the scene to see if one renders properly. If you do find one, can you also let me know which it is? There'll be a log line that gives you the full path. The default main camera is "/SceneAtoms/CoreControl/WorldScaleAdjust/NavRig/[CameraRig]/HeightOffset/MonitorRig"
 
I don't know if this'll fix it, but I added a camera selection option to the UI. My theory is that if you select the right camera then it aught to work.

Can I ask either of you to try all of the cameras you have in the scene to see if one renders properly. If you do find one, can you also let me know which it is? There'll be a log line that gives you the full path. The default main camera is "/SceneAtoms/CoreControl/WorldScaleAdjust/NavRig/[CameraRig]/HeightOffset/MonitorRig"

I tried all the cameras you provided and none worked in VR...
 
I don't know if this'll fix it, but I added a camera selection option to the UI. My theory is that if you select the right camera then it aught to work.

Can I ask either of you to try all of the cameras you have in the scene to see if one renders properly. If you do find one, can you also let me know which it is? There'll be a log line that gives you the full path. The default main camera is "/SceneAtoms/CoreControl/WorldScaleAdjust/NavRig/[CameraRig]/HeightOffset/MonitorRig"

I tried on a Dildo Atom: Now the original atom disappear and anothe one is floating around. It seems linked somehow to the VR head but it's movement are... "strange".

The plugin UI is empty.

I hope you can fix it with VR... :) 💪
 
Does it only works in desktop mod? How do you make this goddamn plugin work? Seriously..???

What i did was:

1. Load it on male
2. Check genitalia?
3....
4. Nothing works?

Can you write step by step tutor? What am i doing wrong?

It hasn't been working for people in VR. I don't have have a headset so it's hard for me to debug.

Beyond what you did, the only thing to try is attaching it to different cameras in the scene to see if any of them work. There's a selector on the right of the UI for it. Unfortunately people are reporting that none of the cameras there work for VR...

It's a long-shot, but I just posted a minor improvement based on some code I got from Everlaster.

If it doesn't work, I might need someone with a headset and a bit of plugin experience to help me debug over discord. Find me at Stopper#0743
 
Back
Top Bottom