Hey everyone,
I just stumbled uppon the “assign shadingGroup” with pymel Problem. After a few experiments, it turned out that it was a syntax problem combined with bad documentation.
It’s not:
sets(my_selected_object, edit=True, forceElement='my_shading_group')
It’s:
sets(orig_sg, mesh_node.getTransform(), forceElement=1)
hope it helps,
Ben