kopia lustrzana https://github.com/vilemduha/blendercam
several changes
-revert new parallel pattern algo, isn't finished yet(parallel stepback problem) -curves, text, can now be used also if parented -scan tools remove small parts tool.pull/62/head
rodzic
cd6b81640a
commit
840bc5cab0
|
@ -787,6 +787,8 @@ def meshFromCurve(o):
|
|||
storage = makeVisible(o)#this is here because all of this doesn't work when object is not visible or on current layer
|
||||
bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(0, 0, 0), "constraint_axis":(False, False, False), "constraint_orientation":'GLOBAL', "mirror":False, "proportional":'DISABLED', "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "texture_space":False, "release_confirm":False})
|
||||
bpy.ops.group.objects_remove_all()
|
||||
bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')
|
||||
|
||||
co=bpy.context.active_object
|
||||
if co.type=='FONT':#support for text objects is only and only here, just convert them to curves.
|
||||
bpy.ops.object.convert(target='CURVE', keep_original=False)
|
||||
|
|
|
@ -57,7 +57,7 @@ def getPathPatternParallel(o,angle):
|
|||
#ar=numpy.array((1.1,1.1))
|
||||
#ar.resize()
|
||||
#defaultar=numpy.arange(int(-dim/pathd), int(dim/pathd)).tolist()
|
||||
if bpy.app.debug_value==1:# by default off
|
||||
if bpy.app.debug_value==0:# by default off
|
||||
#this is the original pattern method, slower, but well tested:
|
||||
dirvect=Vector((0,1,0))
|
||||
dirvect.rotate(e)
|
||||
|
|
|
@ -2535,6 +2535,8 @@ def strategy_drill( o ):
|
|||
|
||||
bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(0, 0, 0), "constraint_axis":(False, False, False), "constraint_orientation":'GLOBAL', "mirror":False, "proportional":'DISABLED', "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "texture_space":False, "release_confirm":False})
|
||||
bpy.ops.group.objects_remove_all()
|
||||
bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')
|
||||
|
||||
ob=bpy.context.active_object
|
||||
if ob.type=='CURVE':
|
||||
ob.data.dimensions='3D'
|
||||
|
|
|
@ -236,7 +236,45 @@ def reconstructmTransform(context):
|
|||
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
|
||||
ob.location=(0,0,0)
|
||||
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
|
||||
|
||||
class RemoveSmallParts(bpy.types.Operator):
|
||||
"""Transform import from reconstructme to blender axes/scale"""
|
||||
bl_idname = "object.remove_small_parts"
|
||||
bl_label = "Remove small parts"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.active_object is not None
|
||||
|
||||
def execute(self, context):
|
||||
removeSmallParts(context)
|
||||
return {'FINISHED'}
|
||||
|
||||
def removeSmallParts(context):
|
||||
actob=bpy.context.active_object
|
||||
bpy.ops.object.editmode_toggle()
|
||||
bpy.ops.mesh.separate(type='LOOSE')
|
||||
bpy.ops.object.editmode_toggle()
|
||||
obs=bpy.context.selected_objects
|
||||
rem=[]
|
||||
nrem=[]
|
||||
for ob in obs:
|
||||
if len(ob.data.vertices)<300:
|
||||
print(ob.name)
|
||||
rem.append(ob)
|
||||
else:
|
||||
nrem.append(ob)
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
for ob in rem:
|
||||
ob.select=True
|
||||
bpy.ops.object.delete(use_global=False)
|
||||
for ob in nrem:
|
||||
ob.select=True
|
||||
bpy.context.scene.objects.active=nrem[0]
|
||||
bpy.ops.object.join()
|
||||
|
||||
|
||||
|
||||
#panel containing all tools
|
||||
class VIEW3D_PT_tools_scantools(bpy.types.Panel):
|
||||
|
@ -253,12 +291,14 @@ class VIEW3D_PT_tools_scantools(bpy.types.Panel):
|
|||
layout.operator("object.reconstructme_trans")
|
||||
layout.operator("object.align_floor")
|
||||
layout.operator("object.remove_floor")
|
||||
layout.operator("object.remove_small_parts")
|
||||
layout.operator("object.make_lod")
|
||||
|
||||
def register():
|
||||
bpy.utils.register_class(ObjectFloor)
|
||||
bpy.utils.register_class(RemoveFloor)
|
||||
bpy.utils.register_class(ReconstructmeTransform)
|
||||
bpy.utils.register_class(RemoveSmallParts)
|
||||
bpy.utils.register_class(MakeLOD)
|
||||
bpy.utils.register_class(VIEW3D_PT_tools_scantools)
|
||||
|
||||
|
@ -267,6 +307,7 @@ def unregister():
|
|||
bpy.utils.unregister_class(ObjectFloor)
|
||||
bpy.utils.unregister_class(RemoveFloor)
|
||||
bpy.utils.unregister_class(ReconstructmeTransform)
|
||||
bpy.utils.unregister_class(RemoveSmallParts)
|
||||
bpy.utils.unregister_class(MakeLOD)
|
||||
bpy.utils.unregister_class(VIEW3D_PT_tools_scantools)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue