Addon, enter values for Geometry Nodes from 3D viewport

Hi.

I am working on a basic addon, I hope it will be a useful alternative to tweak numeric transforms.

There is a working operator which copies LocRot from view3d’s cursor to transform node.

At the moment I try to get a working gizmo, but GIZMO_GT_arrow_3d gizmo does not work as expected.
If I chose “GIZMO_GT_move_3d” instead, moving the gizmo just works. But if I use GIZMO_GT_arrow_3d, the gizmo rest on world origin and cannot be moved.
Sadly, I cannot find much information about how to use GIZMO_GT_arrow_3d.

You can find the addon here …

If you like, there is a gist of the gizmo I try to get working
gist.github.com/leonard7e/de278ddf02067231cafa1498f4a6b52c

I would be thankful if someone helps me to understand how to get a working gizmo with GIZMO_GT_arrow_3d

2 Likes

Mh … I had to move to target_set_prop to get a moving gizmo.

node_active = bpy.data.node_groups['Geometry Nodes'].nodes.active
gz_translation = self.gizmos.new("GIZMO_GT_arrow_3d")
gz_translation.target_set_prop("offset", node_active.inputs['Translation'], "default_value", index=0)

node_active is a “Translation” node. The arrow gizmo points in z-direction.
I like to tweak node_active’s “Translation.z” component. But Blender only accept index < 1. Do you know how it is possible to access Translation[2] or Translation.z in target_set_prop?

The full code is here …
gizmo_test.py

Now the translation gizmo is usable for end users.

Behind there is a modal operator. It does activate the gizmo, and deactivate it with Right-Mouse click or Escape.

The gizmo branch got merged into the main branch. If you like, you could try it. Just download the zip archive and install the addon in Blender.

Rotate and Scale gizmos are todo.