All Questions
103 questions
-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 ...
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 ...
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:
...
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 ...
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, ...
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 ...
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 ...
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 ...
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:
...
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&...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 <...
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:
...
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 ...
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 ...
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?
...
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 ...
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:
...
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 ...
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 ...
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 ...
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 ...
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.
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, ...
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?
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:
...
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 ...
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, ...
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 ...
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 ...
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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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 ...
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; ...
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 ...
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 ...
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 ...