Giter Club home page Giter Club logo

Comments (3)

erich666 avatar erich666 commented on July 16, 2024

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

from cyclesmineways.

JMY1000 avatar JMY1000 commented on July 16, 2024

@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.

from cyclesmineways.

ThomasLynn avatar ThomasLynn commented on July 16, 2024

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).

from cyclesmineways.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.