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

Differentiating between materials used by Mineways and others #14

Closed
JMY1000 opened this issue Jul 18, 2016 · 3 comments
Closed

Differentiating between materials used by Mineways and others #14

JMY1000 opened this issue Jul 18, 2016 · 3 comments
Labels

Comments

@JMY1000
Copy link
Owner

JMY1000 commented Jul 18, 2016

Currently there's not really a great system for checking to see if any given material is related to Mineways or something else that just exists in the scene. Adding some form of checks to help with that beyond what exists would be good.

@JMY1000 JMY1000 added the bug label Jul 18, 2016
@erich666
Copy link
Collaborator

I've read this a few times but am not understanding. Please give a concrete example.

@JMY1000
Copy link
Owner Author

JMY1000 commented Jul 19, 2016

@erich666 It's not important from the Mineways side of things, only from the CyclesMineways. If there's another material that exists for some other reason (like being added by the user), even if it shouldn't be modified by CyclesMineways, due to the current programming, it's possible that it gets modified anyways.

@ThomasLynn
Copy link
Collaborator

Have you tried this out? the code:
if (material.active_texture and len(material.active_texture.name)>=2 and material.active_texture.name[0:2]=="Kd"):
is the protection I put in a while ago.

It works by first checking if "material.active_texture" exists, so the rest of the code doesn't error out. Then it checks to see if the name is >= to 2 length, then if checks if it starts with "Kd". Mineways materials all seem to have "Kd." as their active texture.

Normal Blender users won't use this as it's more of a blender internal engine thing (it is also what controls the "texture view" in blender). For a user to accidentally have their material changed by the script, they would either need to set their own active_texture to something that starts with "Kd"(which is very hard to do accidentally) or copy and paste a Mineways object (untested).

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

No branches or pull requests

3 participants