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

PropertyBinding: fix map property binding regression introduced in #24537 #24603

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

hybridherbst
Copy link
Contributor

@hybridherbst hybridherbst commented Sep 6, 2022

Related issue:

Description

The change to allow map as target object unfortunately broke traversal for general objects, such as what KHR_animation_pointer (#24108) requires for animating materials – while NodeName.map.repeat works it broke MaterialName.map.repeat for animated materials since a material doesn't have a .material property...

This PR fixes that by checking if the animated object already has a map property, because then the indirection to .material.map isn't needed.

cc @Mugen87

Note

My preferred way to fix this would be a broader change in bind() to ensure that when an objectName is found in targetObject that is always used – but that's a separate discussion I think:

if ( objectName && objectName in targetObject ) {

	targetObject = targetObject[ objectName ];

} else if ( objectName ) {

	let objectIndex = parsedPath.objectIndex;
        .... existing special cases ...

@Mugen87 Mugen87 merged commit 25a77e7 into mrdoob:dev Sep 8, 2022
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
@hybridherbst hybridherbst deleted the fix-map-access-regression branch September 27, 2022 15:51
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