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

"Make Sub-Resources Unique" does not make MeshInstance Mesh Material Unique #33823

Open
gururise opened this issue Nov 22, 2019 · 7 comments
Open

Comments

@gururise
Copy link
Contributor

gururise commented Nov 22, 2019

Godot version:
3.2 Beta 2 (also affects 3.1.1)

OS/device including version:
ArchLinux Kernel 5.3.11-arch1-1

Issue description:
Selecting "Make Sub-Resources Unique" on MeshInstance, does not make the sub-resource Mesh material unique. Even making the Mesh itself Unique will not make an attached Material Unique. You have to go to the Mesh Material and select "Make Unique" on the Material itself, then it becomes unique.

Steps to reproduce:

  1. Create 3D Scene
  2. Create new MeshInstance and create a new Mesh (I used simple cube)
  3. Assign new Spatial Material to the newly created Mesh.
  4. Duplicate the MeshInstance created in Step 2
  5. Select new MeshInstance and click "Make Sub-Resources Unique" in Object Properties Menu.
  6. Change properties of the Spatial Material assigned to the Mesh and notice both MeshInstances materials will change. (ie. they are not unique).

Minimal reproduction project:
minimal_project.zip

@gururise gururise changed the title "Make Sub-Resources Unique" does not make MeshInstance Material Unique "Make Sub-Resources Unique" does not make MeshInstance Mesh Material Unique Nov 22, 2019
@Two-Tone
Copy link

On Reddit /u/yearfactmath has said that it works when you comment out continue; on line 229 in core/resource.cpp.

and that

It might also require changing line 102 in editor/inspector_dock.cpp from this:

duplicates[res] = res->duplicate();

to this

duplicates[res] = res->duplicate(true);

That was a change I tested before the first one but I never got around to testing just the commented continue since it takes a while to build godot.

@gururise
Copy link
Contributor Author

gururise commented Nov 23, 2019

Have a look at my pull request #33824. I found that all that was needed was changing line 102 in editor/inspector_dock.cpp. Would be nice if someone else could test the PR linked above.

@aure2006
Copy link

aure2006 commented Dec 4, 2019

I followed your steps to reproduce but when I made sub-resources unique, the SpatialMaterial was deleted from the second MeshInstance. It only gets deleted when set as the MeshInstance's material, not the MeshInstance's mesh material. Attempting to undo will print "Nothing to undo." in the output. Is this a new bug?

Tested with Calinou's latest windows 64-bit build, Godot_v3.2-beta2_win64.exe, and Godot_v3.1-stable_win64.exe.

@gururise
Copy link
Contributor Author

gururise commented Dec 4, 2019

@aure2006 I also just tested with latest nightly on Linux and experience the same BUG you describe. This certainly seems like a new bug, as I don't think this occurred in the Beta2 build. Do you want to make a new bug report?

EDIT: This BUG occurs in 3.1.1, 3.1.2, Beta2 and nightly builds. I guess its not a new bug, but should still be reported!

@aure2006
Copy link

aure2006 commented Dec 5, 2019

If it's not too much to ask, could you make the report please?

@des1redState
Copy link

Also affects 4.0rc1

@aaronfranke
Copy link
Member

What about the (Recursive) option? Is this fixed by #60567?

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

Successfully merging a pull request may close this issue.

6 participants