Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-3 votes
1 answer
37 views

What's wrong with my script! Shading Nodes won't place!

Currently trying to wrap my head around why my script won't place my Brightness/Contrast Node in the desired location and configuration. Shaders for all materials are currently arranged and directly ...
The Vision Tunnel's user avatar
1 vote
2 answers
110 views

How to generate Textures without Rendering to File?

I’m working on a task that involves generating a large number of textures in Blender using Python (bpy) as a standalone (without the GUI). While I can automate the creation of shader nodes, I’m ...
Oren Matar's user avatar
0 votes
1 answer
21 views

How to selecting Principled BSDF node in the shader of the selected object if blender is not set in English

I’ve a basic problem where my code does not work if Blender is not set in English This is the piece of code that I think it’s broken: ...
rikkarlo's user avatar
0 votes
1 answer
47 views

How to save material shading node into a library with bpy (how to export and import shading nodes)

Could someone tell me what are the bpy commands to save a shading node in a library? and how to recover it for another project within blender from this library? @unwave I'm talking about the nodes ...
Certes's user avatar
  • 61
0 votes
0 answers
15 views

How To Fix Naming Conflicts Causing Broken Clothing/Shader UI?

Novice Blender user here 😊 I downloaded two models from a popular character modeler online. The models use the Character-UI add-on by nextr3d to manage clothing/shader options. They are great models, ...
rockafellerskank's user avatar
0 votes
1 answer
96 views

Extract code from Blender Shaders

Still pretty new to blender here, but wow, i'm really enjoying working with it. Next question i've tried to search for information on, is: Is there any way to extract the input- and output-values from ...
Martin's user avatar
  • 11
0 votes
0 answers
198 views

Creating a Custom Node for Materials through Python

I'm trying to create a custom material node in blender using python. For instance, in the example below (which I found here and modified a bit): The node is supposed to take two colors multiply them ...
O. Shehab's user avatar
2 votes
0 answers
38 views

How can I get the final evaluated material color of each face?

I want to be able to get the final evaluated color for each face regardless of what shader node setup I have. I just want to get the final color result flowing into the Base Color socket of the ...
Megan Love's user avatar
0 votes
0 answers
34 views

How to add Inputs and Outputs to Group Node using Python [duplicate]

So I'm trying to write code that creates a custom set of Nodes for the ShaderEditor. Code: ...
Golden Dragon's user avatar
5 votes
3 answers
315 views

draw 3d shape (n-gone) in 3D view

I know how to draw lines, points, 2d shape like rectangle, but how to draw shape by vertices from selected face? So basically, I need to redraw selected faces with 'gpu.state.depth_test_set("NONE&...
APEC's user avatar
  • 649
1 vote
1 answer
83 views

What is the simplest way to achieve viewport-like shading in python?

My final goal is to make a script that can render a collection of meshes, one at a time, from various angles. This problem has been discussed multiple times, such as Blender script import model and ...
Paul92's user avatar
  • 115
4 votes
0 answers
235 views

Migrating geometry shaders to Metal

I'm working on BlenderBIM (architecture addon for Blender) and we have a bunch of shaders to support plan annotations in viewports. Mainly it's simple shapes based of lines - lines, segment based ...
FamousSnake's user avatar
0 votes
0 answers
52 views

How to inject material instance for specific objects?

I am creating an addon that allows you to create multiple shader based section planes. It was quite easy when I dealt with it on per material basis. Now I'm trying to do per Object basis. Now each ...
Jiří Honzák's user avatar
0 votes
1 answer
134 views

How to change selected nodes width in node editor using python?

I am trying to select one node in node editor, then select same type of nodes and change width of all selected nodes using python, this script select same type of nodes but it cannot change its height ...
Yokomizo's user avatar
  • 414
4 votes
0 answers
454 views

Drawing non-polyline smoothed lines with `gpu` module

Backstory: Since bgl module will soon to be deprecated and it's doesn't work on Metal already I was trying to move code to gpu ...
FamousSnake's user avatar
0 votes
1 answer
68 views

How to trigger an event by reseclecting nodes in the shader workspace PYTHON

All I need is actually just a script or something that acts as an event through which other operators can be triggered. The event should be triggered when a user selects a new node in the shader ...
Erasers45-Studios's user avatar
0 votes
1 answer
36 views

What is ObjectShaderFx in bpy?

Searching through the bpy hierarchy in Blender 3.3.3 I've found that objects in Blender have shader_effects attribute. It has <...
Andrey Sokolov's user avatar
0 votes
1 answer
416 views

How to get name of a shader node group in Python (and check if there is a certain shader node inside it)

The material is looking like this: I'm trying with this code: ...
Artichoke's user avatar
  • 413
1 vote
1 answer
274 views

Blender PLY export makes Vertex Colors darker

I wrote a Python script that exports Pointclouds (only vertices) and their vertex-colors (stored in color_attributes) to a .PLY file. The color on the exported .PLY file is way darker than the ...
op. 111's user avatar
  • 21
4 votes
2 answers
1k views

Copy color value from selected vertex - Color Attributes

Do you know any way to copy the exact attribute color values from the selected vertex to the clipboard? I ask because I would like to use vertex painting as id masks to create textures based on only ...
Zyzio's user avatar
  • 195
0 votes
0 answers
321 views

Batch renaming materials to texture name "XPS Shader"

If my node is "XPS_Shader" instead of "BSDF_PRINCIPLED",how to change these code? ...
mini core's user avatar
1 vote
0 answers
342 views

Color alteration in writing and reading image textures using GPU module and Frament shader

I'm trying to understand how to use Fragment shaders in Blender for editing and saving some images. Collecting pieces of information here and there, I produced a simple code that read an image, draw ...
zompa84's user avatar
  • 51
0 votes
1 answer
87 views

Make geometry from GPUShader visible for F12 rendering

I'm using GPUModule with shaders to render some points in the 3D view: ...
j_re's user avatar
  • 1
1 vote
0 answers
118 views

How to change the internal links of a muted node?

i need this node to not destroy my nodetree when muted.. am i missing something? It seems that python give us no possibilities too, node.internal_links has no ...
Fox's user avatar
  • 2,065
1 vote
0 answers
282 views

Cycles: out of SVM stack space, shader "" too big

Any idea on how to increase this? Im working with a rather large node tree and adding #noise.random() as an input value looks like the straw that broke the camels back. I'm able to get it to work if I ...
rtwhite's user avatar
  • 193
0 votes
1 answer
1k views

Find and add MToon shader (from addon) with a script

I'm trying to use python to reproduce this setup : This shader called "MToon_unversioned" comes from this addon : https://vrm-addon-for-blender.info/en/ The problem is that the shader can't ...
platote's user avatar
  • 11
1 vote
1 answer
81 views

Need help with script that loops through a collection and bakes objects

So I'm having some difficulty with a script I wrote that should loop through a collection of objects and bake the materials for each object. I feel like I'm pretty close, but the script is failing at ...
rtwhite's user avatar
  • 193
1 vote
1 answer
350 views

How to change strength of studio light via python? (UPBGE)

Hello I would like to have the studio light strength change from 1 to 0 when entering a new scene. I assume that this is achievable via python, but what would the required script be? Thanks.
Minato's user avatar
  • 65
5 votes
2 answers
281 views

Is it possible to use external resources as images?

I wonder if it is possible to use external image sources (http, ftp, sftp, ...) directly or cached as resources in the shader. The question is not about how to basically download a file with Python, ...
quellenform's user avatar
  • 39.6k
8 votes
3 answers
2k views

Efficient method for putting colormaps into color ramp?

Does anyone have an efficient method for importing color maps into a color ramp? At the moment I have to get the hex codes for each step in a colorramp. Anyone know a better idea?
TheJeran's user avatar
  • 2,905
1 vote
0 answers
179 views

How can I make objects created with the GPU Module visible in the final render?

I used the code example for creating a triangle with custom shader from the official docs: ...
Squis's user avatar
  • 111
0 votes
0 answers
734 views

Batch export 1000 .glb files

I’m trying to batch export 1000 .glb files with a script. the model I want to export uses an image sequence as a image texture that is cycling through 1000 different images. there is also a counter as ...
soulxchild's user avatar
2 votes
1 answer
704 views

Heatmap texture according to object thickness

I made 3D surface reconstruction of a point cloud in meshlab and exported a obj file. I also have computed the thickness of the object and saved the data as "[x,y,thickness]" in a txt file, ...
kevin lee's user avatar
  • 123
1 vote
0 answers
309 views

Blender 3.0 Laser Scan Effect (With Shadows)

im so excited, this is my first Stack Exchange question :) everyday i discover more of the blender community and this is yet another great way to learn :) thanks for reading through this. my aim is to ...
Adrian Stein's user avatar
1 vote
1 answer
643 views

Draw a cube using batch_for_shader

So I'm looking at https://docs.blender.org/api/current/gpu.html?highlight=batch_for_shader I just want to draw a cube with a single color using batch_for_shader(). I'm looking at the "Mesh with ...
Malkalypse's user avatar
1 vote
0 answers
146 views

How to feed Math node with a range of numbers?

Can't come up with how to supply a range of float numbers into the value input of the Math node? Indeed, there is available to set a single float value as well as to plug a bunch of data I wonder ...
Vitalii Sadovshikov's user avatar
1 vote
1 answer
211 views

How can I change the Features in Shader Editor?

how can I change a property in a shader editor in a blender file? I know the code I wrote is ridiculous, but I'm new to the blender library. ...
fighterpilot's user avatar
0 votes
1 answer
455 views

How to create UI list prop for each Material in blender using python

I want to create UI list for each material slot , for example if i select "material 01" one it should only display custom_index which are assigned to material 01 , in short each material ...
draguu's user avatar
  • 319
4 votes
1 answer
194 views

How to script to check the maximum number of textures supported per shader?

I ask this, because I would like to create a python script that checks what is the maximum number of Textures supported for Shader. This would prove very useful in understanding how many different ...
Noob Cat's user avatar
  • 1,372
0 votes
0 answers
72 views

ShapeNet not rendered with two-sided brdf

I am super new to Blender and was trying to render ShapeNet. I used this link as a reference: ShapeNet Renderer. The code works for the most part except some categories such as a car or a plane. I ...
Arshika Lalan's user avatar
3 votes
1 answer
309 views

Packing float32 to vertex color

I am learning vertex animation textures. Already used UV.x as normalised vertex index to animate a flag and it works great. I don't have access to uv2 ("game" engine still under in dev ...
lisichka ggg's user avatar
0 votes
0 answers
162 views

Python select packed image shader editor?

In python, how do I input an image file, add it to an image texture node, and set its properties so that it will be packed into the .blend file? That is, how do I automate the actions in this ...
Emīls Geršinskis-Ješinskis's user avatar
1 vote
0 answers
100 views

Render to float texture using Python API

Is there a way to render to a floating point texture format using blender's python api? Ideally I'd like to render to a RGBA32F. The suggested way to render to texture appears to be gpu.types....
Logan Gilmour's user avatar
0 votes
0 answers
340 views

Is there any way to get node output socket current value with python?

I know that is possible to get the default value of any node, but is there any way to get the current output value of one node? Like in this example below: I would like to get the output[0] current ...
RodrigoGama's user avatar
4 votes
1 answer
761 views

Use custom vertex attribute in Attribute node (shader network)

I was reading this post and this one : Other than copy new data to specific "known" vertex attribute like "Color" for example. There is way to read custom vertex attributes in the ...
barakooda's user avatar
  • 303
0 votes
0 answers
105 views

What is the best way to encode a material into python code?

I'm looking for the most widely applicable a way to convert materials into executable python code, with code. This method should be able to accomodate node groups, and multiple nodes with identically ...
Exporer's user avatar
  • 13
5 votes
1 answer
1k views

Python: selecting node inputs which have the same name

For example the Mixed Shader node has 3 inputs, with names "Fac", "Shader" and "Shader". Note that 2 of the inputs have the same name; ...
David B's user avatar
  • 433
0 votes
1 answer
165 views

2.93 How to compare active view layer in shader editor with driver?

I need to update shader settings for the environment according to the active view layer. I would like to just have a Value node that checks if the active view layer is a specific view layer. Something ...
user391838's user avatar
0 votes
1 answer
889 views

How to access the data from a node socket, for processing it?

I am trying to create a custom node of my own, where I get the input from node sockets, process it (all in code, without involving node groups) and put that processed data to an output node socket to ...
Xafar's user avatar
  • 11
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 ...
Ricky's user avatar
  • 69