Skip to content

Commit

Permalink
feat: rename ring_and_bolt to recon_poly (regular convex polygon) as …
Browse files Browse the repository at this point in the history
…it more accurately represents its behaviour
  • Loading branch information
tristan-hm committed Apr 1, 2022
1 parent 9a5701b commit 4837554
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions generators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import importlib
from . import ring_and_bolt
from . import recon_poly
from . import screw_head


def reload():
importlib.reload(ring_and_bolt)
importlib.reload(recon_poly)
importlib.reload(screw_head)


def register():
ring_and_bolt.register()
recon_poly.register()
screw_head.register()


def unregister():
ring_and_bolt.unregister()
recon_poly.unregister()
screw_head.unregister()
28 changes: 14 additions & 14 deletions generators/ring_and_bolt.py → generators/recon_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
from .. lib.events import capture_modifier_keys


mod_displace = "Radius — ND R&B"
mod_screw_1 = "Width — ND R&B"
mod_screw_2 = "Segments — ND R&B"
mod_decimate = "Decimate — ND R&B"
mod_displace = "Radius — ND RCP"
mod_screw_1 = "Width — ND RCP"
mod_screw_2 = "Segments — ND RCP"
mod_decimate = "Decimate — ND RCP"
mod_summon_list = [mod_displace, mod_screw_1, mod_screw_2]


class ND_OT_ring_and_bolt(bpy.types.Operator):
bl_idname = "nd.ring_and_bolt"
bl_label = "Ring & Bolt"
bl_description = "Adds a ring or ring_and_bolt face at the 3D cursor"
class ND_OT_recon_poly(bpy.types.Operator):
bl_idname = "nd.recon_poly"
bl_label = "Recon Poly"
bl_description = "Adds a regular convex polygon at the 3D cursor"
bl_options = {'UNDO'}


Expand Down Expand Up @@ -217,14 +217,14 @@ def operate(self, context):
self.displace.strength = self.inner_radius


def select_ring_and_bolt(self, context):
def select_recon_poly(self, context):
bpy.ops.object.select_all(action='DESELECT')
self.obj.select_set(True)


def finish(self, context):
if not self.summoned:
self.select_ring_and_bolt(context)
self.select_recon_poly(context)

if self.segments > 3:
self.add_decimate_modifier()
Expand All @@ -234,7 +234,7 @@ def finish(self, context):

def revert(self, context):
if not self.summoned:
self.select_ring_and_bolt(context)
self.select_recon_poly(context)
bpy.ops.object.delete()
elif self.had_decimate_mod or self.segments > 3:
self.add_decimate_modifier()
Expand Down Expand Up @@ -274,15 +274,15 @@ def draw_text_callback(self):


def menu_func(self, context):
self.layout.operator(ND_OT_ring_and_bolt.bl_idname, text=ND_OT_ring_and_bolt.bl_label)
self.layout.operator(ND_OT_recon_poly.bl_idname, text=ND_OT_recon_poly.bl_label)


def register():
bpy.utils.register_class(ND_OT_ring_and_bolt)
bpy.utils.register_class(ND_OT_recon_poly)
bpy.types.VIEW3D_MT_object.append(menu_func)


def unregister():
bpy.utils.unregister_class(ND_OT_ring_and_bolt)
bpy.utils.unregister_class(ND_OT_recon_poly)
bpy.types.VIEW3D_MT_object.remove(menu_func)
unregister_draw_handler()
2 changes: 1 addition & 1 deletion interface/main_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def draw(self, context):
layout.operator("nd.solidify", icon='MOD_SOLIDIFY')
layout.operator("nd.screw", icon='MOD_SCREW')
layout.separator()
layout.operator("nd.ring_and_bolt", icon='MESH_CYLINDER')
layout.operator("nd.recon_poly", icon='MESH_PLANE')
layout.operator("nd.screw_head", icon='CANCEL')
layout.separator()
layout.menu("ND_MT_utils_menu", icon='PLUGIN')
Expand Down
2 changes: 1 addition & 1 deletion interface/main_ui_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def draw(self, context):

row = column.row(align=True)
row.scale_y = 1.2
row.operator("nd.ring_and_bolt", icon='MESH_CYLINDER')
row.operator("nd.recon_poly", icon='MESH_PLANE')

row = column.row(align=True)
row.scale_y = 1.2
Expand Down

0 comments on commit 4837554

Please sign in to comment.