Linked Questions

1
vote
0answers
192 views

How to assign materials to a text via Python [duplicate]

I want to assign different materials to a single text object via Python. This can be done manually by selecting the desired Material slot, typing away, choosing a different material slot and typing ...
17
votes
4answers
15k views

Add Nodes to Material with Python

I have edited a script that creates some nodes, but the only problem is, it always created a new material. I want it to either add the nodes on the existing material, or a pre-defined material. Here ...
11
votes
1answer
13k views

Add material and apply Diffuse color via Python

This may be another simple question but I can't seem to find a straight answer. I am procedurally generating figures and as part of the last step I want to color the figure red. If I manually add a ...
4
votes
2answers
2k views

Assign one material to multiple objects via Python

I am using ePMV Blender addon to import molecular structures into Blender. It generates multiple objects (protein sub-structures called helices, coils and strands) and it assigns a separate material ...
1
vote
2answers
3k views

How can I replace a material from Python?

I read this first to get an idea on assigning materials. How to assign a new material to an object in the scene from Python? I wrote a script to replace one material with another. It seems to work ...
5
votes
1answer
852 views

Assign Material Slot to no material via python

I'd like to, in code, remove a material from a material slot without deleting that material slot (because deleting it would remove the connections between that material slot and the vertices). The ...
2
votes
1answer
1k views

How to get diffuse color of a material via Python?

Since I am used to code with Python in Maya I have trouble getting things to work in Blender. I want to do something specific based on the name of its material that is applied. But I am really ...
0
votes
2answers
1k views

Blender 2.8 Python : How Do I Find My Material Output Node (and assign displacement)

I am attempting to create a displacement node with an attached image, and connect that to the Main Material Output Node. I feel I understand how to create and connect these pieces (mostly) fine now. ...
1
vote
1answer
1k views

How to assign a color value to face (object) using python

I have the following two functions: ...
0
votes
2answers
671 views

Iterate through objects then parent and add material based on string search in names

I've imported a model from the BodyParts3D database (http://lifesciencedb.jp/bp3d/) It's made up of a huge number of .obj files. These have a name based on the anatomical structure/organ: My question ...
0
votes
3answers
306 views

How to assign a material to a mesh object with python?

Creating Materials using python is easy and it has a lot of answers on StackExchange. Now what I want to ask is - If I want that the material should only be added if the object (on which material ...
3
votes
1answer
975 views

Getting the actual (not default) input value of a node group for a specific user

I've spent far too long googling for this answer. :) I have a Cycles shader node group called ProteinVR that I created using the node editor. It has two inputs: This same node group is used by ...
0
votes
0answers
492 views

How to convert this vertex paint into a useable material (scripted)?

I have a single, the all-in-one mesh object created and then vertex-painted with a script. I can see the colors in vertex paint mode, but I haven't been able to successfully turn it into a renderable (...
0
votes
0answers
418 views

How to add an emission node with a specific color to a material and add that material to an object? [duplicate]

So far I have seen this and this both which did not work for me. Currently I have: ...
3
votes
0answers
250 views

Example of creating and setting a Cycles material node with the Python API [duplicate]

I'm trying to set the properties of a Cycles material, which is linked to a Plane object, using the API. So far this is what I'...

15 30 50 per page