Hey not sure if this would be kosher to post or not. But I tasked AI with fixing the path issue when loading profiles, exposing the offset camera parameters so most the time I don't even need profiles (my main reason for doing this), and look for any easy performance gains last night. Tried it and it worked properly, but far from extensive. I have 2 versions. .1 was just exposing the offset and fixing the profilepath. .5 included some other changes aimed at QOL and performance. Haven't tested performance really yet, just thought it might be useful to small scene creators. But 1 change I made was to reinitialize on pose change so when I am possessed my head isn't across the room or ruining the pose when I change animations. There is a checkbox to turn it off. Disclaimer I'm just a user of embody and do not claim to understand the inner workings.
https://mega.nz/folder/F2lTgLJK#o2dSTeMPYaTG5n0XCY2oJQ
Behavior changes:
- Fixed LoadProfileWithPath so it loads the profile directly instead of routing through the file path URL storable.
- Exposed triggerable JSON storables for Offset Camera:
- CameraDepthAdjust
- CameraHeightAdjust
- CameraPitchAdjust
- ClipDistance
- Added trigger/UI controls for pose-change reinitialization:
- AutoReinitializeOnPoseChange
- PoseLinkCheckInterval
- PoseReinitializeCooldown
- LogPoseReinitialize
- Added Eye Target LowOverheadMode.
- Added pose-link monitoring so active possession can quickly deactivate/reactivate if a pose change breaks controller links.
- Added small active-frame performance tweaks in Passenger, Hide Geometry, and Eye Target.
Important non-change: the internal script path is still Custom/Scripts/AcidBubbles/Embody/..., so the code structure is basically AcidBubbles Embody with targeted patches, not a broad rewrite.
Just sharing in case someone is similar to me and just wants to move the head down and up and not use passenger. AcidBubbles, if you want to take any of this you are welcome to take all or parts of it. Diff for .5 version in mega link as well. I have it named differently to not affect the current version.
.1 version diff. This is all that changed to embody.cs. This is the minimally invasive option.
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -125,6 +125,13 @@ public class Embody : MVRScript, IEmbody
presetsJSON = InitPresets();
RegisterStringChooser(presetsJSON);
+ if (offsetCameraModule != null)
+ {
+ RegisterFloat(offsetCameraModule.cameraDepthJSON);
+ RegisterFloat(offsetCameraModule.cameraHeightJSON);
+ RegisterFloat(offsetCameraModule.cameraPitchJSON);
+ RegisterFloat(offsetCameraModule.clipDistanceJSON);
+ }
_context.automation.enabledJSON.val = true;
@@ -193,7 +200,10 @@ public class Embody : MVRScript, IEmbody
RegisterUrl(_loadProfileWithPathUrlJSON);
_loadProfileWithPathJSON = new JSONStorableActionPresetFilePath("LoadProfileWithPath", url =>
{
- _loadProfileWithPathUrlJSON.SetFilePath(url);
+ _loadProfileWithPathUrlJSON.valNoCallback = url;
+ new Storage(_context).LoadProfile(url);
+ _screensManager.Show(null);
+ _screensManager.Show(MainScreen.ScreenName);
}, _loadProfileWithPathUrlJSON);
RegisterPresetFilePathAction(_loadProfileWithPathJSON);