• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. 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.

Question Scripting for proper move player camera

Datel

New member
Joined
Jul 23, 2024
Messages
29
Reactions
20
Situation: After setting up depth of field params, changing pose and some scene props, I am returning toadjust depth of field params, but camera position and angle not the same as before and not comfortable to adjust params.
I am working on script which should move and rotate player camera to be aligned to atom (WindowCamera mostly). How to properly setup position and rotation for player params?

After some debugging, i figured out that default player camera rotation has this things:
SuperController.singleton.centerCameraTarget.transform - always have zero position and rotation. Changing position makes incorrect behavior, like when person should look at player, he looking with offset, and controller icons also rotating.
SuperController.singleton.navigationRig.transform - localPosition: x, z for moving, but seems with offset, y always 0. localRotation: x, z always 0, y for left/right camera rotation.
SuperController.singleton.MonitorCenterCamera.transform - localPosition always (0.0, 1.6, 0.0), localRotation: x for camera up/down rotation, y, z always 0.
SuperController.singleton.playerHeightAdjust - variable for y offset wneh camera rotating around focus point and Z/X buttons movement. Also this value changing by changing WorldScale.

I dont really know how this should work. I can just set global position but some things like height adjust will be incorrect, maybe some other plugins using this value and it can broke something.
Also i dont know how to modify focus point to rotate camera around it and zoom via mouse wheel. (SuperController.singleton.focusDistance)
 
Last edited:
Assuming you are using PostMagic Depth-of-Field...it has an AutoFocus feature with does auto-adjust the FocusDistance. For that to work you need to place an 'Empty' atom into the scene and name it 'AutoFocusPoint', and attach it to a person head, animate it or whatever. Also enable "AutoFocus" and possibly "AutoFocus WindowCamera" check boxes in the DoF settings.

As you are talking about WindowCamera, I'm not sure why you want to move the player camera. You can toggle in and out of WindowCamera by pressing M. Make sure the WindowCamera is actually enabled. The WindowCamera can be animated, just like any other atom.

If you indeed want to move the Player camera, I would recommend using AcidBubbles Embody plugin. You can embody a Person...or just an 'Empty' atom. Then animate either the Person or the Empty atom using the regular means (Timeline or whatever) to move the camera.

If you like to move the camera in VR and also control rotation, you can look at my Benchmark plugin code. Because Embody does not allow that. That is because controlling rotation in VR is strongly NOT recommended. It can become uncomfortable in seconds, even for people not that sensitive to motion sickness. Really, not recommended.
 
Upvote 0
Assuming you are using PostMagic Depth-of-Field...it has an AutoFocus feature with does auto-adjust the FocusDistance. For that to work you need to place an 'Empty' atom into the scene and name it 'AutoFocusPoint', and attach it to a person head, animate it or whatever. Also enable "AutoFocus" and possibly "AutoFocus WindowCamera" check boxes in the DoF settings.

As you are talking about WindowCamera, I'm not sure why you want to move the player camera. You can toggle in and out of WindowCamera by pressing M. Make sure the WindowCamera is actually enabled. The WindowCamera can be animated, just like any other atom.

If you indeed want to move the Player camera, I would recommend using AcidBubbles Embody plugin. You can embody a Person...or just an 'Empty' atom. Then animate either the Person or the Empty atom using the regular means (Timeline or whatever) to move the camera.

If you like to move the camera in VR and also control rotation, you can look at my Benchmark plugin code. Because Embody does not allow that. That is because controlling rotation in VR is strongly NOT recommended. It can become uncomfortable in seconds, even for people not that sensitive to motion sickness. Really, not recommended.

Thank you for answer.
Yeah, i am using PostMagic Depth-of-Field. AutoFocus works only for FocalLength, i need adjust an Aperture too with different distance. Also, would be nice to choose atom from list, because adding parent to AutoFocus atom changing it's name and plugin does not work with it, but i would like to save subscene with all things.
Pressing M button has short stutter and it is hiding UI, so it is not really comfortable to setup scene with toggling M button.
I did not test Embody, but it is quite big solution for just put camera back to old position.
I dont have VR, desktop only for now.

I just wonder why VAM has 3 or more different transforms which works by parts and how to proper use it. I made working version of plugin, but it moves default player position to zero, seems not a big problem because the default value is not centered, and other scripters ignoring the right position :unsure:
 
Last edited:
Upvote 0
Back
Top Bottom