Open tokejepsen opened 4 years ago
Workfiles prototype
v002
instead of closing v001
. Maybe the Workfiles app needs to have an Close active workfile
option?Menu Items
File > Scripts
. This would certainly be the quickest way to get going, but it would not allow for very easy updates. If we add a menu item, a new script will need to be deployed to each workstation.Window > Extensions
. Again updates to the extension would need to be distributed and installed on each workstation. But CEP can render html, so we could potentially host a local server and have the CEP extension be a passthrough.Extension
Workfiles
button is hosted in the extension, so not easily updatable but its a start.Looks like a good start indeed !!
Separate Flask Server
Running a Flask server with the Workfiles
/Create...
etc. buttons. Which means no hacked execution of batch scripts;
@app.route("/workfiles_route")
def workfiles_route():
io.install()
api.register_host(avalon.photoshop)
workfiles.show()
# Required return statement.
return "nothing"
avalon
module folder; https://github.com/getavalon/launcher/blame/1cec0a92e6af6e627072486d3f38bd53786981b3/launcher/lib.py#L17.
Is this not "dangerous" since we are assuming the avalon module is pulled as a git repository? @davidlatwe LayerSets
as they are known as in the Javascripting. This is a good candidate for a container for output.Unfortunately LayerSets
cannot store metadata, so a possible solution is to have a layer within the LayerSet
that stores the metadata for the container.
Certainly not ideal since the user can move the metadata layer around, but we can also link the layer and LayerSet
to ensure we can get the metadata.
One issue with using metadata on a layer, is that the user cannot actually interact with the data.
For example in Maya data is imprinted on the container, which allows users to manually change this data after creation.
It might be useful with a tools that reads/writes this imprinted data, so DCCs like Photoshop can have same interaction as Maya.
When getting deeper into the integration it got apparent that passing objects around to different functions (imprint
for example), communicating with Photoshop over socket/port became very tricky. So I took the "cheap" way out, and added the pywin32
(on Windows) dependency.
Maybe in the future there will be python library we can make use of.
avalon.photoshop.Creator
This involved other required methods; imprint
and maintained_selection
. Getting deeper into XMPMetadata
turned out to be needlessly tricky. Instead I've opted to store the metadata in the file info Headline
field. There may be a better place for this, but I chose this because (1) it provides easy access for debugging and (2) the Headline
field in Photoshop is a multi-line edit so its a easy to copy.
Since I'm not storing the metadata on each layer instance, I've resorted to using each layers id
which is unique. The data is a dictionary with these ids:
{
"189": {
"id": "pyblish.avalon.instance",
"family": "image",
"asset": "Bruce",
"subset": "imageDefault",
"active": true
}
}
The nice thing about this approach is that LayerSet
s have ids as well, so there no need for additional layers as described here, making is cleaner and less user error prone.
Documenting this to be fixed later.
When opening the Creator tool for the second time after creating an instance, this message appears:
Traceback (most recent call last):
File "C:\Users\admin\avalon-docker\volume\git\avalon-core\avalon\tools\creator\app.py", line 465, in <lambda>
lib.schedule(lambda: widget.setText(""), 5000, channel="message")
RuntimeError: wrapped C/C++ object of type QLabel has been deleted
Publishing and Loading
Being able to go full circle marks the completion of the draft version of the Photoshop integration. Will look at documentation and PR tomorrow.
Issue
This is about a Photoshop (PS) Integration for Avalon.
Implementation