libreflow.extensions.sk.export-psd-layers 1.1.8__tar.gz → 1.1.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/CHANGELOG.md +12 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8/src/libreflow.extensions.sk.export_psd_layers.egg-info → libreflow_extensions_sk_export_psd_layers-1.1.10}/PKG-INFO +13 -1
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow/extensions/sk/export_psd_layers/__init__.py +107 -8
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow/extensions/sk/export_psd_layers/_version.py +3 -3
- libreflow_extensions_sk_export_psd_layers-1.1.10/src/libreflow/extensions/sk/export_psd_layers/scripts/PSD_crop_layers.jsx +41 -0
- libreflow_extensions_sk_export_psd_layers-1.1.10/src/libreflow/extensions/sk/export_psd_layers/scripts/__init__.py +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10/src/libreflow.extensions.sk.export_psd_layers.egg-info}/PKG-INFO +13 -1
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow.extensions.sk.export_psd_layers.egg-info/SOURCES.txt +3 -1
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/MANIFEST.in +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/README.md +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/setup.cfg +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/setup.py +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow/__init__.py +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow/extensions/__init__.py +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow/extensions/sk/__init__.py +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow.extensions.sk.export_psd_layers.egg-info/dependency_links.txt +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow.extensions.sk.export_psd_layers.egg-info/requires.txt +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/src/libreflow.extensions.sk.export_psd_layers.egg-info/top_level.txt +0 -0
- {libreflow_extensions_sk_export_psd_layers-1.1.8 → libreflow_extensions_sk_export_psd_layers-1.1.10}/versioneer.py +0 -0
|
@@ -19,6 +19,18 @@ Types of changes
|
|
|
19
19
|
|
|
20
20
|
## [Unreleased]
|
|
21
21
|
|
|
22
|
+
## [1.1.10] - 2025-10-30
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
* Optimize the cropping action to run only if there is layer to crop on a list.
|
|
27
|
+
|
|
28
|
+
## [1.1.9] - 2025-10-17
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
* Cropping process in extend script into Photoshop for oversize layers, in BG layout task.
|
|
33
|
+
|
|
22
34
|
## [1.1.8] - 2025-10-07
|
|
23
35
|
|
|
24
36
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libreflow.extensions.sk.export_psd_layers
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.10
|
|
4
4
|
Home-page: https://gitlab.com/lfs.coop/libreflow/libreflow_launcher
|
|
5
5
|
Author: Thomas Thiebaut
|
|
6
6
|
Author-email: autor@les-fees-speciales.coop
|
|
@@ -50,6 +50,18 @@ Types of changes
|
|
|
50
50
|
|
|
51
51
|
## [Unreleased]
|
|
52
52
|
|
|
53
|
+
## [1.1.10] - 2025-10-30
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
* Optimize the cropping action to run only if there is layer to crop on a list.
|
|
58
|
+
|
|
59
|
+
## [1.1.9] - 2025-10-17
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
* Cropping process in extend script into Photoshop for oversize layers, in BG layout task.
|
|
64
|
+
|
|
53
65
|
## [1.1.8] - 2025-10-07
|
|
54
66
|
|
|
55
67
|
### Fixed
|
|
@@ -13,11 +13,88 @@ from libreflow.baseflow.file import (
|
|
|
13
13
|
PublishFileAction,
|
|
14
14
|
TrackedFile,
|
|
15
15
|
UploadPNGToKitsu,
|
|
16
|
+
GenericRunAction,
|
|
17
|
+
WaitProcess,
|
|
16
18
|
)
|
|
17
19
|
from libreflow.flows.default.flow.film import Film
|
|
18
20
|
from psd_tools import PSDImage
|
|
19
21
|
|
|
20
22
|
|
|
23
|
+
class WaitCroppingAction(WaitProcess):
|
|
24
|
+
|
|
25
|
+
_file = flow.Parent()
|
|
26
|
+
|
|
27
|
+
def allow_context(self, context):
|
|
28
|
+
return False
|
|
29
|
+
|
|
30
|
+
def get_run_label(self):
|
|
31
|
+
return 'Restart export layers'
|
|
32
|
+
|
|
33
|
+
def _do_after_process_ends(self, *args, **kwargs):
|
|
34
|
+
self._file.export_layers.run("Export")
|
|
35
|
+
|
|
36
|
+
class CroppingPSDLayers(GenericRunAction):
|
|
37
|
+
"""Crop layerswith a bouding box twice as large as the file size."""
|
|
38
|
+
|
|
39
|
+
ICON = ("icons.flow", "photoshop")
|
|
40
|
+
|
|
41
|
+
_file = flow.Parent()
|
|
42
|
+
|
|
43
|
+
file_path = flow.Param()
|
|
44
|
+
|
|
45
|
+
def allow_context(self, context):
|
|
46
|
+
return context
|
|
47
|
+
|
|
48
|
+
def runner_name_and_tags(self):
|
|
49
|
+
"""Get the name and tags for a runner.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
str, list: name and tags for a runner
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
return "Photoshop", []
|
|
56
|
+
|
|
57
|
+
def get_run_label(self):
|
|
58
|
+
return "Cropping Layers"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def extra_argv(self):
|
|
62
|
+
"""Build the list of command-line arguments required for export in Photoshop.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
list[str]: command-line arguments for the Photoshop export process.
|
|
66
|
+
|
|
67
|
+
"""
|
|
68
|
+
current_directory = os.path.split(__file__)[0]
|
|
69
|
+
script_path = os.path.normpath(
|
|
70
|
+
os.path.join(current_directory, "scripts/PSD_crop_layers.jsx")
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
return [self.file_path.get(), script_path]
|
|
74
|
+
|
|
75
|
+
def run(self, button):
|
|
76
|
+
"""Execute the render action.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
button (str): The label of the button pressed by the user (e.g., 'Export' or 'Cancel').
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
Any: the result of the parent run method if executed, or None if canceled.
|
|
83
|
+
|
|
84
|
+
"""
|
|
85
|
+
if button == "Cancel":
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
runner_dict = super(CroppingPSDLayers, self).run(button)
|
|
89
|
+
psb_runner = (
|
|
90
|
+
self.root().session().cmds.SubprocessManager.get_runner_info(runner_dict["runner_id"])
|
|
91
|
+
)
|
|
92
|
+
self._file.wait_cropping_action.wait_pid(psb_runner["pid"])
|
|
93
|
+
self._file.wait_cropping_action.run('wait')
|
|
94
|
+
|
|
95
|
+
return runner_dict
|
|
96
|
+
|
|
97
|
+
|
|
21
98
|
class ExportPSDLayers(flow.Action):
|
|
22
99
|
"""Exports Photoshop (PSD/PSB) layers for background layout and color tasks."""
|
|
23
100
|
|
|
@@ -61,7 +138,9 @@ class ExportPSDLayers(flow.Action):
|
|
|
61
138
|
"""
|
|
62
139
|
msg = ""
|
|
63
140
|
if self._task.name() == "bg_layout":
|
|
64
|
-
msg = "<b>Layout : Photoshop Project layers will be exported separately</b>
|
|
141
|
+
msg = """<b>Layout : Photoshop Project layers will be exported separately</b><br><br>
|
|
142
|
+
<font color=orange>If some layers are twice as large as the document size, Photoshop will be open to crop them.</font>
|
|
143
|
+
"""
|
|
65
144
|
elif self._task.name() == "bg_color":
|
|
66
145
|
msg = (
|
|
67
146
|
"<b>BG Color : Photoshop Project will be exported as a single image</b>"
|
|
@@ -283,16 +362,21 @@ class ExportPSDLayers(flow.Action):
|
|
|
283
362
|
bbox_bottom - bbox_top,
|
|
284
363
|
)
|
|
285
364
|
|
|
286
|
-
if not (bbox_height <= v_height *
|
|
287
|
-
layers_to_crop.append(descendant
|
|
365
|
+
if not (bbox_height <= v_height * 1.5 or bbox_width <= v_width * 1.5):
|
|
366
|
+
layers_to_crop.append(descendant)
|
|
288
367
|
|
|
289
368
|
if len(layers_to_crop) != 0:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
369
|
+
for layer in layers_to_crop:
|
|
370
|
+
cropping_action = self._file.cropping_psd_layers
|
|
371
|
+
cropping_action.file_path.set(source_revision.get_path())
|
|
372
|
+
self._file.cropping_psd_layers.run("Export")
|
|
373
|
+
session.log_warning(log_format.format(
|
|
374
|
+
message=f"Open Photoshop to crop these layers : {layers_to_crop}"
|
|
375
|
+
)
|
|
293
376
|
)
|
|
294
|
-
|
|
295
|
-
|
|
377
|
+
session.log_info(log_format.format(
|
|
378
|
+
message="Following export processes will be displayed on the processes view."))
|
|
379
|
+
return self.get_result(close=True)
|
|
296
380
|
|
|
297
381
|
for layer in reversed(psb):
|
|
298
382
|
|
|
@@ -967,6 +1051,19 @@ class CreateWorkingCopy(CreateWorkingCopyAction):
|
|
|
967
1051
|
self.from_revision.revert_to_default()
|
|
968
1052
|
|
|
969
1053
|
return ["Create", "Create from scratch", "Cancel"]
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
def wait_cropping_action(parent):
|
|
1057
|
+
if isinstance(parent, TrackedFile) and "psb" in parent.name():
|
|
1058
|
+
r = flow.Child(WaitCroppingAction).ui(hidden=True)
|
|
1059
|
+
r.name = "wait_cropping_action"
|
|
1060
|
+
return r
|
|
1061
|
+
|
|
1062
|
+
def cropping_psd_layers(parent):
|
|
1063
|
+
if isinstance(parent, TrackedFile) and "psb" in parent.name():
|
|
1064
|
+
r = flow.Child(CroppingPSDLayers).ui(hidden=True)
|
|
1065
|
+
r.name = "cropping_psd_layers"
|
|
1066
|
+
return r
|
|
970
1067
|
|
|
971
1068
|
|
|
972
1069
|
def publish_psd_file(parent):
|
|
@@ -1034,5 +1131,7 @@ def install_extensions(session):
|
|
|
1034
1131
|
publish_and_export_preview,
|
|
1035
1132
|
publish_psd_file,
|
|
1036
1133
|
create_working_copy,
|
|
1134
|
+
cropping_psd_layers,
|
|
1135
|
+
wait_cropping_action,
|
|
1037
1136
|
]
|
|
1038
1137
|
}
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2025-10-
|
|
11
|
+
"date": "2025-10-30T15:55:40+0100",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "1.1.
|
|
14
|
+
"full-revisionid": "af462ecb99d28c4c275daae07bb9440cc468a829",
|
|
15
|
+
"version": "1.1.10"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var activeDoc = app.activeDocument;
|
|
2
|
+
|
|
3
|
+
doc_width = activeDoc.width;
|
|
4
|
+
doc_height = activeDoc.height;
|
|
5
|
+
|
|
6
|
+
var layers_list = new Array;
|
|
7
|
+
var layer_to_crop = new Array;
|
|
8
|
+
|
|
9
|
+
main();
|
|
10
|
+
|
|
11
|
+
function main() {
|
|
12
|
+
CollectAllLayers(activeDoc)
|
|
13
|
+
for (var i = 0; i < layers_list.length; i++){
|
|
14
|
+
layer_width = layers_list[i].bounds[2] - layers_list[i].bounds[0];
|
|
15
|
+
layer_height = layers_list[i].bounds[3] - layers_list[i].bounds[1];
|
|
16
|
+
|
|
17
|
+
if (layer_width > doc_width * 1.5 || layer_height > doc_height * 1.5){
|
|
18
|
+
layer_to_crop.push(layers_list[i]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (layer_to_crop.length > 0) {
|
|
22
|
+
activeDoc.crop([0, 0, doc_width, doc_height])
|
|
23
|
+
}
|
|
24
|
+
activeDoc.save()
|
|
25
|
+
executeAction(app.charIDToTypeID('quit'), undefined, DialogModes.NO);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Collect all layers in a document
|
|
29
|
+
function CollectAllLayers(obj){
|
|
30
|
+
for ( var i = obj.layers.length-1; 0 <= i; i--){
|
|
31
|
+
var layer = obj.layers[i];
|
|
32
|
+
if (layer.typename === "ArtLayer"){
|
|
33
|
+
layers_list.push(obj.layers[i]);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
CollectAllLayers(obj.layers[i]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return layers_list;
|
|
40
|
+
}
|
|
41
|
+
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libreflow.extensions.sk.export_psd_layers
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.10
|
|
4
4
|
Home-page: https://gitlab.com/lfs.coop/libreflow/libreflow_launcher
|
|
5
5
|
Author: Thomas Thiebaut
|
|
6
6
|
Author-email: autor@les-fees-speciales.coop
|
|
@@ -50,6 +50,18 @@ Types of changes
|
|
|
50
50
|
|
|
51
51
|
## [Unreleased]
|
|
52
52
|
|
|
53
|
+
## [1.1.10] - 2025-10-30
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
* Optimize the cropping action to run only if there is layer to crop on a list.
|
|
58
|
+
|
|
59
|
+
## [1.1.9] - 2025-10-17
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
* Cropping process in extend script into Photoshop for oversize layers, in BG layout task.
|
|
64
|
+
|
|
53
65
|
## [1.1.8] - 2025-10-07
|
|
54
66
|
|
|
55
67
|
### Fixed
|
|
@@ -13,4 +13,6 @@ src/libreflow.extensions.sk.export_psd_layers.egg-info/top_level.txt
|
|
|
13
13
|
src/libreflow/extensions/__init__.py
|
|
14
14
|
src/libreflow/extensions/sk/__init__.py
|
|
15
15
|
src/libreflow/extensions/sk/export_psd_layers/__init__.py
|
|
16
|
-
src/libreflow/extensions/sk/export_psd_layers/_version.py
|
|
16
|
+
src/libreflow/extensions/sk/export_psd_layers/_version.py
|
|
17
|
+
src/libreflow/extensions/sk/export_psd_layers/scripts/PSD_crop_layers.jsx
|
|
18
|
+
src/libreflow/extensions/sk/export_psd_layers/scripts/__init__.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|