full WIP parent operator

This commit is contained in:
pullusb
2023-12-13 10:22:09 +01:00
parent 8cccc7ba8c
commit b3edd51284
3 changed files with 64 additions and 42 deletions
+21
View File
@@ -91,6 +91,27 @@ def ray_cast_point(point, origin, depsgraph):
return object_hit, np.array(hit_location), tri, tri_indices
def empty_at(name='Empty', pos=(0,0,0), collection=None, type='PLAIN_AXES', size=1, show_name=False):
'''
Create an empty at given Vector3 position.
Optional type (default 'PLAIN_AXES') in ,'ARROWS','SINGLE_ARROW','CIRCLE','CUBE','SPHERE','CONE','IMAGE'
default size is 1.0
'''
mire = bpy.data.objects.get(name)
if not mire:
mire = bpy.data.objects.new(name, None)
if collection is None:
collection = bpy.context.collection
if mire.name not in collection.all_objects:
collection.objects.link(mire)
mire.location = pos
mire.empty_display_type = type
mire.empty_display_size = size
mire.show_name = show_name
return mire
def plane_on_bone(bone, arm=None, cam=None, set_rotation=True, mesh=True):
'''
bone (posebone): reference pose bone