Skip to content

Eo 26922 bindable roots in controller expressions - #108

Open
ccpHenry wants to merge 8 commits into
mainfrom
EO-26922-Bindable-roots-in-controller-expressions
Open

ccpHenry wants to merge 8 commits into
mainfrom
EO-26922-Bindable-roots-in-controller-expressions

Conversation

@ccpHenry

@ccpHenry ccpHenry commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary: Controller expressions can now read float attributes straight from bound objects using path syntax in the expression field ( for example Owner.translation.x or SpaceObjectParent.someAttr )

the problem before this:
right now when artists need to use attribute variables in controllers the go-to methood is sto bind it into one of the variables. This is a bit problematic as often that variable is only needed once or only in certain controller subsections.
Another problem is that getting variables from above the level where the controller sits it requires a lot of extra effort and another controller on a higher level to pass that variable down.
This change attempts to fix both problems at once by making it so variables can be fetched on demand and up the tree

some notes:

  • If a root isn't attached yet, its references stay pending and get resolved lazily. They evaluate to 0 until they resolve. (spawned in effectChildren etc)
  • When parsing an expression, Tr2ControllerExpression looks for paths that start with a known root. Each one becomes a Tr2BindingPoint.
  • A path that can't be bound gives the error cannot bind "" to a float attribute.
    Owner and SpaceObjectParent now appear under a new "Bindings" group in the expression term info, so artists can have some help remembering this feature

img of an example use:
image

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v21.1.8

Click here for the full clang-format patch
diff --git a/trinity/Controllers/ITr2Controller.h b/trinity/Controllers/ITr2Controller.h
index 422a834..85822ae 100644
--- a/trinity/Controllers/ITr2Controller.h
+++ b/trinity/Controllers/ITr2Controller.h
@@ -56 +56 @@ BLUE_INTERFACE( ITr2Controller ) :
-void UpdateSpaceObjectParentRoot( std::vector<std::pair<std::string, IRoot*>> & roots, IRoot * owner );
+void UpdateSpaceObjectParentRoot( std::vector<std::pair<std::string, IRoot*>>& roots, IRoot* owner );

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/Controllers/ITr2Controller.h Outdated
@github-actions
github-actions Bot dismissed their stale review September 28, 2026 16:48

outdated suggestion

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v21.1.8

Click here for the full clang-format patch
diff --git a/trinity/Controllers/ITr2Controller.h b/trinity/Controllers/ITr2Controller.h
index 422a834..85822ae 100644
--- a/trinity/Controllers/ITr2Controller.h
+++ b/trinity/Controllers/ITr2Controller.h
@@ -56 +56 @@ BLUE_INTERFACE( ITr2Controller ) :
-void UpdateSpaceObjectParentRoot( std::vector<std::pair<std::string, IRoot*>> & roots, IRoot * owner );
+void UpdateSpaceObjectParentRoot( std::vector<std::pair<std::string, IRoot*>>& roots, IRoot* owner );

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/Controllers/ITr2Controller.h

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Reference handling introduces undefined pointer arithmetic, naming collisions, stale dynamic bindings, and misleading diagnostics.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Adds bindable object-root paths to controller expressions, including owner and space-object-parent attributes.

Changes:

  • Rewrites binding paths into parser variables evaluated through Tr2BindingPoint.
  • Adds dynamic Owner and SpaceObjectParent roots.
  • Extends binding-path parsing and validity checks.
File Description
Tr2TimelineController.cpp Exposes binding roots and expression metadata.
Tr2ControllerExpression.h Defines reference-binding state.
Tr2ControllerExpression.cpp Rewrites, binds, and evaluates references.
Tr2Controller.cpp Resolves space-object-parent roots.
Tr2BindingPoint.h Exposes path matching.
Tr2BindingPoint.cpp Improves path parsing and binding validity.
ITr2Controller.h Declares the root-update helper.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread trinity/Controllers/Tr2ControllerExpression.cpp
This should not affect anything but now the comparator is strictly defined

runs the range check first, using std::less, and only subtracts once the pointer is known to be inside the first view

None of the other lines do pointer arithmetic, so there's nothing to change. It looks like Copilot grouped them in by mistake?
@github-actions
github-actions Bot dismissed their stale review September 29, 2026 14:29

outdated suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants