Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMCL-1621: add isdelayed to near and far clip plane fields #1032

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions com.unity.cinemachine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- CameraDeactivated events were not sent consistently when a blend interrupted another blend before completion.
- CameraActivated events were not sent consistently when activation was due to timeline blends.

### Changed
- Added delayed processing to near and far clip plane inspector fields for the CinemachineCamera lens.


## [3.1.2] - 2024-10-01

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,18 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
var innerFovControl = foldout.AddChild(new FovPropertyControl(property, false));

var nearClip = property.FindPropertyRelative(() => s_Def.NearClipPlane);
foldout.AddChild(new PropertyField(nearClip)).RegisterValueChangeCallback((evt) =>
var nearClipField = foldout.AddChild(new PropertyField(nearClip));
nearClipField.OnInitialGeometry(() => nearClipField.SafeSetIsDelayed());
nearClipField.RegisterValueChangeCallback((evt) =>
{
if (!IsOrtho(property) && nearClip.floatValue < 0.01f)
{
nearClip.floatValue = 0.01f;
property.serializedObject.ApplyModifiedPropertiesWithoutUndo();
}
});
foldout.Add(new PropertyField(property.FindPropertyRelative(() => s_Def.FarClipPlane)));
var farClipField = foldout.AddChild(new PropertyField(property.FindPropertyRelative(() => s_Def.FarClipPlane)));
farClipField.OnInitialGeometry(() => farClipField.SafeSetIsDelayed());
foldout.Add(new PropertyField(property.FindPropertyRelative(() => s_Def.Dutch)));

var physical = foldout.AddChild(new PropertyField(property.FindPropertyRelative(() => s_Def.PhysicalProperties)));
Expand Down
Loading