fix export json crop

0.6.7

- fix: export json crop use scene name instead of first found GP.
main
Pullusb 2021-11-11 14:36:57 +01:00
parent b587794ac5
commit 4bdd6e9fb9
3 changed files with 17 additions and 5 deletions

View File

@ -14,6 +14,11 @@ Activate / deactivate layer opaticty according to prefix
Activate / deactivate all masks using MA layers Activate / deactivate all masks using MA layers
--> -->
0.6.7
- fix: export json crop use scene name instead of first found GP.
0.6.6 0.6.6
- fix: problem when creating Json - fix: problem when creating Json

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, 6, 6), "version": (0, 6, 7),
"blender": (2, 93, 0), "blender": (2, 93, 0),
"location": "View3D", "location": "View3D",
"warning": "", "warning": "",

15
fn.py
View File

@ -822,12 +822,19 @@ def export_crop_to_json():
for scn in bpy.data.scenes: for scn in bpy.data.scenes:
# if scn.name in {'Scene', 'Render'}: # if scn.name in {'Scene', 'Render'}:
if scn.name == 'Scene': # if scn.name == 'Scene':
continue # continue
if scn.render.use_border: if scn.render.use_border:
scn_border = get_crop_pixel_coord(scn) scn_border = get_crop_pixel_coord(scn)
for ob in [o for o in scn.objects if o.type == 'GPENCIL']: ## use scn name
coord_dic[ob.name] = scn_border coord_dic[scn.name] = scn_border
## use name of first found GP :
# gps = [o for o in scn.objects if o.type == 'GPENCIL']
# if gps:
# for ob in gps:
# coord_dic[ob.name] = scn_border
# else:
# coord_dic[scn.name] = scn_border
if coord_dic: if coord_dic:
json_path.parent.mkdir(parents=False, exist_ok=True) json_path.parent.mkdir(parents=False, exist_ok=True)