fix rename lowercase with target modifier

0.5.2

- fix: `rename lowercase` also change modifier layer target names (else target was broken)
main
Pullusb 2021-10-01 12:58:46 +02:00
parent 65c7142786
commit 79e2e058f3
4 changed files with 18 additions and 5 deletions

View File

@ -14,6 +14,10 @@ Activate / deactivate layer opaticty according to prefix
Activate / deactivate all masks using MA layers Activate / deactivate all masks using MA layers
--> -->
0.5.2
- fix: `rename lowercase` also change modifier layer target names (else target was broken)
0.5.1 0.5.1
- feat: reconnect existing sockets inside nodegroups with clean nodes > re-order - feat: reconnect existing sockets inside nodegroups with clean nodes > re-order

View File

@ -3,12 +3,12 @@
## Todo ## Todo
- on renaming, correct also names in GP modifiers !!!
- opt: multi-merge : also merge merged NG automatically disabling AA without group (or externalise AA node ?) - opt: multi-merge : also merge merged NG automatically disabling AA without group (or externalise AA node ?)
- opt : How to disable main output - opt : How to disable main output
- To add : Reconnect inside nodegroup for nodes when using clean nodes
## Done ## Done
- set exlude VL on non-used layers - set exlude VL on non-used layers
- set real AA nodegroup - set real AA nodegroup
- disable all masks (with filter) - disable all masks (with filter)
- Reconnect inside nodegroup for nodes when using clean nodes
- on renaming, correct also names in GP modifiers

View File

@ -2,7 +2,7 @@ bl_info = {
"name": "GP Render", "name": "GP Render",
"description": "Organise export of gp layers through compositor output", "description": "Organise export of gp layers through compositor output",
"author": "Samuel Bernou", "author": "Samuel Bernou",
"version": (0, 5, 1), "version": (0, 5, 2),
"blender": (2, 93, 0), "blender": (2, 93, 0),
"location": "View3D", "location": "View3D",
"warning": "", "warning": "",

11
fn.py
View File

@ -723,9 +723,18 @@ def normalize_layer_name(layer, prefix='', desc='', suffix='', lower=True, dash_
new = f'{grp}{tag}{name}{sfix}' # lower suffix ? new = f'{grp}{tag}{name}{sfix}' # lower suffix ?
if new != layer.info: if new != layer.info:
print(f'{layer.info} >> new') old = layer.info
print(f'{old} >> {new}')
layer.info = new layer.info = new
# Also change name string in modifier target !
for ob in [o for o in bpy.data.objects if o.type == 'GPENCIL' and o.data == layer.id_data]:
for m in ob.grease_pencil_modifiers:
if hasattr(m, 'layer') and m.layer:
if m.layer == old:
print(f' - updated in {ob.name} modifier {m.name}')
m.layer = new
## confirm pop-up message: ## confirm pop-up message:
def show_message_box(_message = "", _title = "Message Box", _icon = 'INFO'): def show_message_box(_message = "", _title = "Message Box", _icon = 'INFO'):
def draw(self, context): def draw(self, context):