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

Flow Graph Path Mapping #14481

Merged
merged 8 commits into from
Nov 7, 2023
Merged

Conversation

carolhmj
Copy link
Contributor

@carolhmj carolhmj commented Oct 31, 2023

Changes

  • On the SetPropertyBlock, add a new parameter named subString, which represents a string that will be substituted by a node value if encountered between {}. For example, if the subString is nodeIndex, and the path is /node/{nodeIndex}/, when this node is activated, it will look into the nodeIndex socket, and substitute its value (which could be 0, then the path would be /node/0). This allows dynamic paths that are resolved based on the current state of the scene.
    • This change will be needed because of how the glTF Interactivity uses paths. In some cases, paths are defined as /node/{nodeIndex}/property, and we want these paths to be resolved at runtime.
  • The SetProperty node was changed to use a configuration object instead of sockets. The configuration object contains a string path (as defined in the context variables), and a string property, such as translation, rotation, etc.
  • I also moved the default serialization and parsing functions to a separate module, and added handling of vector values.
  • I also removed the variableDefinitions value, as it wasn't being used and made things more complex.

@carolhmj carolhmj requested a review from RaananW October 31, 2023 18:07
@bjsplat
Copy link
Collaborator

bjsplat commented Oct 31, 2023

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 31, 2023

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 31, 2023

Copy link
Member

@RaananW RaananW left a comment

Choose a reason for hiding this comment

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

I think it can be abstracted a bit more, to support future changes.
There should be a path, and a configurable map of replacement values. it should then take the value from the context, based on the map key, instead of fixing the nodeIndex as a property.
GetTargetFromPath can be a static member of FlowGraph (or the context). This was it can be used on other future blocks as well.

packages/dev/core/src/FlowGraph/flowGraphContext.ts Outdated Show resolved Hide resolved
Copy link
Member

@RaananW RaananW left a comment

Choose a reason for hiding this comment

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

Looks great! just a few nitty comments.

packages/dev/core/src/FlowGraph/flowGraphContext.ts Outdated Show resolved Hide resolved
packages/dev/core/src/FlowGraph/flowGraphContext.ts Outdated Show resolved Hide resolved
@carolhmj carolhmj merged commit 204260b into BabylonJS:master Nov 7, 2023
10 checks passed
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.

None yet

3 participants