Skip to content

Commit

Permalink
blender-qrn v.1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
don1138 committed Jan 31, 2023
1 parent f577b2f commit 22564fb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Select one or more Nodes to activate the buttons.
+ **440**
+ **550**
+ **640**
+ **200**
+ **700 (Max Width)** - The least practical option, so obviously it deserves the largest button. 😊

### 👉 Toggle Hidden Sockets
Expand All @@ -36,16 +37,6 @@ But no matter – The buttons are still a convenient shortcut for tweaking Node

This addon pairs well with 3DSinghVFX's work-in-progress [**Align Nodes**](https://github.com/3DSinghVFX/align_nodes).

## Version History

**1.2**
+ Moved *'Set Node Width'* label inside `If` statement

**1.1**
+ Changed scope from **Active** to **All Selected**
+ Added options for **540**, **640**, and **700**
+ Added Button for **Toggle Hidden Sockets**

<br><br>

<p align="center">
Expand Down
30 changes: 25 additions & 5 deletions resize_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@
"""
VERSION HISTORY
1.2.1 - Code refactoring
- PEP8 formatting
1.3.0 - 01/31/23
- Add new width: 200
1.2 - 18/03/22
1.2.1 - 12/17/22
- Code refactoring
- PEP8 formatting
1.2.0 - 18/03/22
- Moved label "Set Node Width" inside IF statement
1.1 - 20/09/22
1.1.0 - 20/09/22
- Changed scope from Active to All Selected
- Added Button for Toggle Hidden Sockets
Expand All @@ -38,7 +42,7 @@
bl_info = {
"name" : "QRN (Quick Resize Node)",
"author" : "Don Schnitzius",
"version" : (1, 2, 1),
"version" : (1, 3, 0),
"blender" : (2, 80, 0),
"location" : "Node Editor > Sidebar > Arrange",
"description": "Assign a Fixed Width to Selected Nodes",
Expand Down Expand Up @@ -99,6 +103,8 @@ def draw_panel(self, layout):
row.operator('node.button_640')

row = layout.row(align=True)
row.operator('node.button_200')
row.scale_x = 2.0
row.operator('node.button_700')

row = layout.row(align=True)
Expand Down Expand Up @@ -197,6 +203,19 @@ def execute(self, context):
return {'FINISHED'}


class RN_OT__NodeButton200(Operator):
"""Set node width to 200"""
bl_idname = 'node.button_200'
bl_label = '200'

def execute(self, context):
nodes, links = get_nodes_links(context)
for node in nodes:
if node.select == True:
node.width = 200
return {'FINISHED'}


class RN_OT__NodeButtonHideToggle(Operator):
"""Toggle Hidden Node Sockets"""
bl_idname = 'node.button_toggle_hidden'
Expand All @@ -215,6 +234,7 @@ def execute(self, context):
RN_OT__NodeButton440,
RN_OT__NodeButton540,
RN_OT__NodeButton640,
RN_OT__NodeButton200,
RN_OT__NodeButton700,
RN_OT__NodeButtonHideToggle
]
Expand Down

0 comments on commit 22564fb

Please sign in to comment.