Linked Questions

1 vote
0 answers
267 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 ...
tobkum's user avatar
  • 984
0 votes
1 answer
73 views

How to Assign Material to Object with Python? [duplicate]

How can I change the material of my object (Hand) with Python? I do not want to add a new material. I just want to assign an existing material.
BBlender's user avatar
23 votes
4 answers
27k 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 ...
rioforce's user avatar
  • 2,032
12 votes
1 answer
20k 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 ...
switchup621's user avatar
8 votes
1 answer
9k views

Modify obj after import using python

I am trying to modify an object after importing it. This post is related to this question ...
Ross's user avatar
  • 257
4 votes
2 answers
7k 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 ...
Aiena's user avatar
  • 160
3 votes
1 answer
3k views

How to load an image from disc and assign it to a newly created image texture node?

I'm trying to load an image from jpeg file and to add the material to the cube using the following code: ...
Dini's user avatar
  • 31
3 votes
2 answers
1k views

How to assign a material to a single face of a mesh using Python API

I have tried the following but the mat is not assigned to any of the faces. ...
Ignacio Alorre's user avatar
4 votes
2 answers
3k 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 ...
marcheenek's user avatar
5 votes
1 answer
2k views

How do I iterate over all selected objects and change a property on their materials?

import bpy for material_slot in bpy.data.objects['Cube'].material_slots: material_slot.material.show_transparent_back = False I have managed to access to the ...
pekkuskär's user avatar
0 votes
3 answers
3k 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 ...
Rakesh choudhary's user avatar
5 votes
1 answer
1k 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 ...
SamFall's user avatar
  • 312
1 vote
2 answers
4k 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. ...
WillSmithsRobot's user avatar
0 votes
2 answers
2k views

How can I turn nodes that made in shader editor to script? [duplicate]

I want to make a button and when I press it, it will apply the material I made, that mean the nodes. I try different way to type script but it wasn't work. ...
8N Films's user avatar
  • 163
2 votes
1 answer
2k 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 ...
Lala_Ghost's user avatar

15 30 50 per page