I created a "voxel" data visualization system via DICOM files in Blender. However, as the DICOM changes from patient to patient, it is necessary to allow the user to change the transparency of the slices, for this it is necessary to link the parameters to a node group.
The problem is that I am unable to link an existing group in the scene during the lasso -for-, when creating the slices from DICOM.
I tried this command:
bpy.ops.node.add_node (type = "ShaderNodeGroup", use_transform = True, settings = [{"name": "node_tree", "value": "bpy.data.node_groups ['GroupVoxelShader']"}])
But it gives error of poll() failed.
So I tried to create the node group inside the material first and then make a link, so it creates a block, but with the following name: Missing Data-Block.
I tried to find a way to link with the group bpy.data.node_groups['GroupVoxelShader']
as shown in the image below:
But I can only do this manually, it was not possible to link automatically already in lasso, with Python.
Does anyone know how to do this? Thanks for reading!