Linked Questions

1 vote
1 answer
110 views

How to assign a material to multiple faces with python? [duplicate]

How to assign a material to multiple faces with python? As shown in the following image, there is a cube, I subdivide one big face into 49 small faces, then I assign the green material to the 49 small ...
0 votes
1 answer
79 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.
1 vote
1 answer
1k views

How can I apply an image texture to a certain part of a mesh?

I have a mesh, with 16 faces, that I ultimately show in Blender Game Engine, and want to apply separate textures to the faces via a script. The reason behind this is I'm trying to show a detailed ...
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. ...
3 votes
1 answer
4k 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: ...
8 votes
1 answer
10k views

Modify obj after import using python

I am trying to modify an object after importing it. This post is related to this question ...
1 vote
1 answer
867 views

Interacting with material_slot in python

I am working on a project with mesh created with photogrammetry (mainly). Once the mesh is imported, I would like to apply through scripts different materials before render them. But Sometimes, I use ...
0 votes
1 answer
1k views

Append Materials Using Python [duplicate]

Trying to append a material from one blend file to another but not having any luck. I've tried two methods so far. Method 1: ...
5 votes
1 answer
3k 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 ...
0 votes
0 answers
20 views

Blender 2.9 - script how to add a material shader nodes tree? [duplicate]

In blender 2.9, I got a selected object and need to add a new material in a new slot with a script addon. I need some examples for doing a material shader nodes tree in 2.9 Ex: How to adding some ...
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. ...
0 votes
1 answer
2k views

How to import a STL file using the file browser?

I'm trying to import a stl file manually via python. My code below is pretty straight forward, but I'm struggling with the following line. I'm not sure about the syntax and format of the arguments: <...
0 votes
0 answers
40 views

Add a created group in a node tree exploiting python [duplicate]

I have created a node tree in a different blend file, and I just need to add it as a group exploiting a script. In the following figure there is the "manual" procedure. I have tried to add ...
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 ...
24 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 ...

15 30 50 per page