Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def CLONE_SOURCE_OBJECT (tile_object, source_plane):
- new_obj_name = tile_object+'_SOURCE_COPY'
- if not (tile_object in CLONE_SOURCE_OBJECT.Items):
- bpy.ops.object.select_all(action='DESELECT')
- bpy.data.objects[source_plane].select = True
- bpy.context.scene.objects.active = bpy.data.objects[source_plane]
- SPD_x, SPD_y, SPD_z = bpy.context.active_object.dimensions
- bpy.ops.object.select_all(action='DESELECT')
- bpy.data.objects[tile_object].select = True
- bpy.context.scene.objects.active = bpy.data.objects[tile_object]
- scn = bpy.context.scene
- src_obj = bpy.data.objects[tile_object]
- new_obj = src_obj.copy()
- new_obj.data = src_obj.data.copy()
- new_obj = src_obj.copy()
- new_obj.data = src_obj.data.copy()
- new_obj.animation_data_clear()
- new_obj.name = new_obj_name
- NOD_x, NOD_y, NOD_z = bpy.context.active_object.dimensions
- NOL_x = (NOD_x)/2
- NOL_y = (NOD_y)/2
- NOL_z = (SPD_z)
- new_obj.location = (NOL_x,NOL_y,NOL_z)
- scn.objects.link(new_obj)
- CLONE_SOURCE_OBJECT.Items[tile_object] = new_obj_name
- return new_obj_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement