Skip to content

Commit

Permalink
Beta 4 update
Browse files Browse the repository at this point in the history
  • Loading branch information
passivestar committed Nov 22, 2023
1 parent 74f0707 commit 0bdfea3
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
32 changes: 28 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ class JoinSeparateOperator(bpy.types.Operator):
reset_origin: BoolProperty(name='Reset Origin on Separate', default=True)
reset_drivers: BoolProperty(name='Reset Drivers on Separate', default=True)

@classmethod
def poll(cls, context):
if is_in_editmode() and not anything_is_selected_in_editmode():
return False
return True

def execute(self, context):
if is_in_editmode():
if anything_is_selected_in_editmode():
Expand Down Expand Up @@ -560,6 +566,10 @@ class MirrorOperator(bpy.types.Operator):
axis: BoolVectorProperty(name='Axis', subtype='XYZ')
bisect_flip: BoolVectorProperty(name='Bisect Flip', subtype='XYZ')

@classmethod
def poll(cls, context):
return len(context.selected_objects) > 0

def draw(self, context):
l = self.layout
l.row().prop(self.properties, 'axis', toggle=1)
Expand Down Expand Up @@ -606,6 +616,10 @@ class ArrayOperator(bpy.types.Operator):
count: IntProperty(name='Count', default=3, step=1, min=0)
offset: FloatProperty(name='Offset', default=1.1)

@classmethod
def poll(cls, context):
return len(context.selected_objects) > 0

def execute(self, context):
v = view_snapped_vector() * self.offset
v.negate()
Expand Down Expand Up @@ -774,8 +788,9 @@ def poll(cls, context):
return is_in_editmode()

def execute(self, context):
bpy.ops.mesh.select_mode(use_extend=False, use_expand=False, type='EDGE')
if self.from_islands: bpy.ops.qm.mark_seams_from_islands()
bpy.ops.qm.select_sharp_edges(sharpness=self.sharpness)
bpy.ops.mesh.edges_select_sharp(sharpness=self.sharpness)
bpy.ops.qm.mark_seam()
bpy.ops.mesh.select_mode(use_extend=False, use_expand=False, type='FACE')
return {'FINISHED'}
Expand Down Expand Up @@ -808,7 +823,7 @@ class TransformUVsOperator(bpy.types.Operator):

@classmethod
def poll(cls, context):
return is_in_editmode()
return is_in_editmode() and anything_is_selected_in_editmode()

def execute(self, context):
me = bpy.context.edit_object.data
Expand Down Expand Up @@ -1114,6 +1129,7 @@ def execute(self, context):

file = bpy.path.basename(bpy.data.filepath).split('.')[0]
file_directory = os.path.dirname(bpy.data.filepath)
active_collection_name_clean = re.sub(r'[^a-zA-Z0-9_]', '_', bpy.context.view_layer.active_layer_collection.name)

# Save the blend file
bpy.ops.wm.save_mainfile()
Expand All @@ -1128,6 +1144,14 @@ def execute(self, context):
export_apply=self.apply_modifiers,
filepath=file_directory + file + '.glb'
)
elif self.mode == 'gltf':
bpy.ops.export_scene.gltf(
export_format='GLTF_SEPARATE',
export_apply=self.apply_modifiers,
export_keep_originals=True,
use_active_collection=self.batch_mode == 'COLLECTION',
filepath = os.path.join(file_directory, active_collection_name_clean if self.batch_mode == 'COLLECTION' else file + '.gltf')
)
elif self.mode == 'fbx':
bpy.ops.export_scene.fbx(
mesh_smooth_type='EDGE',
Expand All @@ -1138,7 +1162,7 @@ def execute(self, context):
bake_anim_use_nla_strips=False,
bake_space_transform=self.apply_transform,
batch_mode=self.batch_mode,
filepath=file_directory + file + '.fbx' if self.batch_mode == 'OFF' else file_directory
filepath=os.path.join(file_directory, file + '.fbx') if self.batch_mode == 'OFF' else file_directory
)
else:
self.report({'ERROR'}, 'Unknown export extension')
Expand Down Expand Up @@ -1179,7 +1203,7 @@ def execute(self, context):
# @QuickMenu

class QuickMenu(bpy.types.Menu):
bl_idname, bl_label = 'OBJECT_MT_quick_menu', 'Quick Menu (v.3 beta 3)'
bl_idname, bl_label = 'OBJECT_MT_quick_menu', 'Quick Menu (v.3 beta 4)'

def draw(self, context):
layout = self.layout
Expand Down
14 changes: 11 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,18 @@
"path": "Generate/(E) Extrude Both Ways", "operator": "geometry.execute_node_group",
"params": { "name": "QMT Extrude Both Ways" }
},
{ "path": "Generate/(R) Convex Hull", "operator": "mesh.convex_hull" },
{
"path": "Generate/(T) Cables", "operator": "geometry.execute_node_group",
"path": "Generate/(R) Panel", "operator": "geometry.execute_node_group",
"params": { "name": "QMT Panel" }
},
{ "path": "Generate/(T) Convex Hull", "operator": "mesh.convex_hull" },
{
"path": "Generate/(Y) Cables", "operator": "geometry.execute_node_group",
"params": { "name": "QMT Cables" }
},
{ "path": "Generate/[Separator]" },
{
"path": "Generate/(Y) Edges To Ropes", "operator": "geometry.execute_node_group",
"path": "Generate/(G) Edges To Ropes", "operator": "geometry.execute_node_group",
"params": { "name": "QMT Edges To Ropes" }
},
{ "path": "Generate/[Separator]"},
Expand Down Expand Up @@ -293,6 +298,7 @@
"scale_y": 1
}
},
{ "path": "(W) UV and Textures/(R) Pack Islands", "operator": "uv.pack_islands" },

{ "path": "(W) UV and Textures/[Separator]" },

Expand Down Expand Up @@ -359,7 +365,9 @@
{ "path": "(D) Tool/(E) Measure", "operator": "qm.tool", "params": { "tool_name": "builtin.measure" } },
{ "path": "(D) Tool/(R) Knife", "operator": "qm.tool", "params": { "tool_name": "builtin.knife" } },
{ "path": "(F) Mode", "operator": "view3d.object_mode_pie_or_toggle" },

{ "path": "(Z) Files/(Q) Export GLB", "operator": "qm.export", "params": { "mode": "glb" } },
{ "path": "(Z) Files/(W) Export GLTF Active Collection", "operator": "qm.export", "params": { "mode": "gltf", "batch_mode": "COLLECTION" } },

{ "path": "(Z) Files/[Separator]" },

Expand Down
Binary file modified nodetools.blend
Binary file not shown.

0 comments on commit 0bdfea3

Please sign in to comment.