Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Python is an interactive, object-oriented programming language. In Blender, it is used as a general-purpose scripting language and to create add-ons to extend Blender's functionality.
0
votes
0
answers
64
views
Can't assign a byte data to the StringProperty subtype 'BYTE_STRING' in 2.93
I have a code similar to this, that creates a custom property for objects and then assigns a data from file to it but it stops working in Blender 2.93. I tested it in 2.79 and 2.80 with no problems bu …
2
votes
1
answer
936
views
How to get bpy.data.textures from the scene material?
I'm writing a script that creates a few bpy.data.textures objects, adds textures to them then adds a few custom properties. These textures will then be applied to the materials in the scene but before …
3
votes
How to get bpy.data.textures from the scene material?
I came up with a code similar to this that at least works
import bpy
def get_textures_from_the_material(blender_material):
textures = []
if blender_material:
if blender_material.node_ …
3
votes
0
answers
46
views
How to create unsigned Int property?
I need a property that can accept the 2267538950 number, unfortunately by default Blender uses a signed int range. There was a way to set subtype="UNSIGNED" in the previous versions but it doesn't wor …
1
vote
0
answers
175
views
How to transfer the shader group node creation code to a class?
# NOTE: this is not the same as the standard __init__ function in Python, which is
# a purely internal Python method and unknown to the node system! …
0
votes
1
answer
281
views
How to get UV layer data by layer name?
I have a code that works with this line:
uv_layer = blender_mesh_object.data.uv_layers[0]
But I need to expand this for 2 more UV layers with the names "lightmap" and "data", they both are optional s …
1
vote
1
answer
117
views
How to get vertex colors efficiently?
I need to export vertex colors from Blender to a custom mesh format. To do it, I need to create a dictionary where the vertex index is a key and color is a value, as proof of concept I wrote this but …
0
votes
How to get vertex colors efficiently?
My friend helped to get rig the nested loop and this reduced the execution time of the function in extreme cases from 0.5 to 0.3 seconds
def _get_vertex_colors(blender_mesh):
mesh = blender_mesh.d …
0
votes
1
answer
246
views
How to use correctly uv.seams_from_islands()?
I wrote a simple code based on this answer python: Split mesh by uv islands that should convert UV island borders to seams and then select them as edges but it worked unstably. …
3
votes
1
answer
2k
views
How to add a driver by python for a custom property?
I just want to link a custom property from the texture data to a mapping node Scale input in the material but I can't get how to do it from examples
material_basic = bpy.data.materials.new(name = "Bas …
0
votes
0
answers
57
views
How to store custom properties that use int and float vector property to json?
I wrote a simple code that gets the custom properties I've added to materials and stores them in a dictionary, then this dictionary I write to json file. And it worked until I added IntVectorProperty …
0
votes
0
answers
13
views
This mathutils related code stop working correctly in 2.8 [duplicate]
I ported an old 2.78 addon and was faced with a strange thing, the results in 2.78 and 2.93 are different. In 2.93 the result of the multiplication of matrices is always remaining the same as Matrix.T …
0
votes
0
answers
116
views
Blender won't save custom texture data to the blend file
I have an addon that creates texture data, adds a few custom properties and an image, but after saving there is no texture data is here. Blender 2.93
2
votes
How to add a driver by python for a custom property?
Okay, I figure out what I did wrong. The main problem was I added a driver to the custom property instead of the node input
material_basic = bpy.data.materials.new(name = "Basic")
material_basic.use_n …