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
-->
0.5.2
- fix: `rename lowercase` also change modifier layer target names (else target was broken)
0.5.1
- feat: reconnect existing sockets inside nodegroups with clean nodes > re-order

View File

@ -3,12 +3,12 @@
## 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 : How to disable main output
- To add : Reconnect inside nodegroup for nodes when using clean nodes
## Done
- set exlude VL on non-used layers
- 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",
"description": "Organise export of gp layers through compositor output",
"author": "Samuel Bernou",
"version": (0, 5, 1),
"version": (0, 5, 2),
"blender": (2, 93, 0),
"location": "View3D",
"warning": "",

11
fn.py
View File

@ -723,8 +723,17 @@ def normalize_layer_name(layer, prefix='', desc='', suffix='', lower=True, dash_
new = f'{grp}{tag}{name}{sfix}' # lower suffix ?
if new != layer.info:
print(f'{layer.info} >> new')
old = layer.info
print(f'{old} >> {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:
def show_message_box(_message = "", _title = "Message Box", _icon = 'INFO'):