1
$\begingroup$

A follow up question to How to get Geometry nodes modifier inputs and its type using python

But the code:

bpy.data.objects["Cube"].modifiers["GeometryNodes"]["Input_2_attribute_name"] = "UVMap"

does not work

here "UVMap" can be any attributes like points position, vertex group indicator etc. But assigning the name does not work. We cannot find the corresponding code in the script window in GUI. It only tells us the above code, which does not work. It is surely a bug. But how to solve it?

$\endgroup$

1 Answer 1

1
$\begingroup$

Solved by

bpy.context.object.modifiers["SAND_MATMASK"]['Input_2_attribute_name'] = "SAND_MATMASK"
bpy.context.object.modifiers["SAND_MATMASK"].show_viewport = False
bpy.context.object.modifiers["SAND_MATMASK"].show_viewport = True
$\endgroup$
1
  • $\begingroup$ Please mark it as an answer as well :) $\endgroup$ Commented Jan 19, 2022 at 21:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.