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

Editor: Fixed material-related commands #28362

Closed
wants to merge 1 commit into from

Conversation

ycw
Copy link
Contributor

@ycw ycw commented May 13, 2024

Related: #28345 ( issue 3 )

Issue: All material related commands SetMaterialXXXCommand are failed to UNDO/REDO

In execute() and undo(), the material is referencing to the one cached at construction time, it may not be the same material that materialChanged signal is dispatching for.

This PR fixed that by getting material via given object, materialSlot in execute() and undo(), instead of using cached one, s.t. it must be the same material as the one materialChanged is dispatching for:

const material = this.editor.getObjectMaterial( this.object, this.materialSlot )

// do stuff with material

this.editor.signals.materialChanged.dispatch( this.object, this.materialSlot )

@mrdoob
Copy link
Owner

mrdoob commented May 17, 2024

Issue: All material related commands SetMaterialXXXCommand are failed to UNDO/REDO

Are they?

Screen.Recording.2024-05-17.at.5.31.34.PM.mov

@ycw
Copy link
Contributor Author

ycw commented May 17, 2024

Issue: All material related commands SetMaterialXXXCommand are failed to UNDO/REDO

Are they?

Screen.Recording.2024-05-17.at.5.31.34.PM.mov

yes, for the SetMaterialXXXCommand listed 'how to test' section in #28345

@Mugen87 Mugen87 added this to the r165 milestone May 17, 2024
@ycw
Copy link
Contributor Author

ycw commented May 17, 2024

would be great if you closes a PR with a reason...

@Mugen87
Copy link
Collaborator

Mugen87 commented May 17, 2024

Sorry, when they are linked in other PRs, they get automatically closed.

@mrdoob
Copy link
Owner

mrdoob commented May 27, 2024

yes, for the SetMaterialXXXCommand listed 'how to test' section in #28345

Do you mind explaining it again here? I don't understand the description.

@ycw
Copy link
Contributor Author

ycw commented May 27, 2024

yes, for the SetMaterialXXXCommand listed 'how to test' section in #28345

Do you mind explaining it again here? I don't understand the description.

This PR fixed these commands listed in #28345 'How to test':

list:

image

The video #28362 (comment) you posted was testing just one of them.

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