Skip to content

Add multimaterial support to inspector v2 #16966

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bghgary
Copy link
Contributor

@bghgary bghgary commented Aug 4, 2025

Material explorer:
image

Children section in material properties:
image

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 4, 2025

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 Aug 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 4, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16966/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16966/merge/?snapshot=refs/pull/16966/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 4, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16966/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 4, 2025

Building or testing the sandbox has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16966/merge/testResults/

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 4, 2025

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16966/merge/testResults/

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 4, 2025

@bghgary bghgary marked this pull request as ready for review August 5, 2025 00:23
@bghgary bghgary enabled auto-merge (squash) August 5, 2025 00:24
@bjsplat
Copy link
Collaborator

bjsplat commented Aug 5, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16966/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16966/merge/?snapshot=refs/pull/16966/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 5, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16966/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 5, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 5, 2025

return (
<>
{multiMaterial.subMaterials.map((material, index) => (
<LinkPropertyLine label={`Material #${index + 1}`} value={material!.name} onLink={() => (selectionService.selectedEntity = material)} />
Copy link
Contributor

Choose a reason for hiding this comment

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

once this PR gets checked in your can use LinkToEntityPropertyLine

#16967

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 5, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16966/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 5, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16966/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16966/merge/?snapshot=refs/pull/16966/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 5, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 5, 2025


return (
<>
{multiMaterial.subMaterials.map((material, index) => (
Copy link
Member

Choose a reason for hiding this comment

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

This is a case where using keys will be better. If the material list changes, this might yield wrong results, and even if it doesn't it will make reconciliation more efficient if keys are provided. The key could probably just be the unique id of the material.

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

Successfully merging this pull request may close these issues.

5 participants