remove premiere

This commit is contained in:
Milan Kolar 2021-04-01 16:09:12 +02:00
parent 1d4852aea9
commit 211c6f7f4a
74 changed files with 0 additions and 53065 deletions

View file

@ -1,6 +0,0 @@
## How to
1. start aport server
1. a. deregistering path could be used [](http://localhost:4242/pipeline/deregister_plugin_path)
2. set aport into correct context by [](http://localhost:4242/pipeline/context?project=jakub_projectx&asset=shot02&task=rotopaint&app=premiera)
3. register premiera publish plugin path [](http://localhost:4242/pipeline/register_plugin_path?publish_path=C:/Users/hubert/CODE/pype-setup/repos/pype-config/pype/plugins/premiere/publish)
4. publish with test json file [](http://localhost:4242/pipeline/publish?json_data_path=C:/Users/hubert/CODE/pype-setup/repos/pype-config/pype/premiere/example_publish_reqst.json)

View file

@ -1,70 +0,0 @@
from avalon import api as avalon
from pyblish import api as pyblish
from pype.api import Logger
from .lib import (
setup,
reload_pipeline,
ls,
LOAD_PATH,
CREATE_PATH,
PUBLISH_PATH
)
__all__ = [
"setup",
"reload_pipeline",
"ls"
]
log = Logger().get_logger(__name__)
def install():
"""Install Premiere-specific functionality of avalon-core.
This is where you install menus and register families, data
and loaders into Premiere.
It is called automatically when installing via `api.install(premiere)`.
See the Maya equivalent for inspiration on how to implement this.
"""
# Disable all families except for the ones we explicitly want to see
family_states = [
"imagesequence",
"mov"
]
avalon.data["familiesStateDefault"] = False
avalon.data["familiesStateToggled"] = family_states
log.info("pype.hosts.premiere installed")
pyblish.register_host("premiere")
pyblish.register_plugin_path(PUBLISH_PATH)
log.info("Registering Premiera plug-ins..")
avalon.register_plugin_path(avalon.Loader, LOAD_PATH)
avalon.register_plugin_path(avalon.Creator, CREATE_PATH)
def uninstall():
"""Uninstall all tha was installed
This is where you undo everything that was done in `install()`.
That means, removing menus, deregistering families and data
and everything. It should be as though `install()` was never run,
because odds are calling this function means the user is interested
in re-installing shortly afterwards. If, for example, he has been
modifying the menu or registered families.
"""
pyblish.deregister_host("premiere")
pyblish.deregister_plugin_path(PUBLISH_PATH)
log.info("Deregistering Premiera plug-ins..")
avalon.deregister_plugin_path(avalon.Loader, LOAD_PATH)
avalon.deregister_plugin_path(avalon.Creator, CREATE_PATH)

View file

@ -1,20 +0,0 @@
@echo off
rem You need https://github.com/Adobe-CEP/CEP-Resources/raw/master/ZXPSignCMD/4.1.1/win64/ZXPSignCmd.exe
rem You need https://partners.adobe.com/exchangeprogram/creativecloud/support/exman-com-line-tool.html
rem !!! make sure you run windows power shell as admin
set pwd="12PPROext581"
echo ">>> creating certificate ..."
.\ZXPSignCmd -selfSignedCert CZ Prague OrbiTools "Signing robot" %pwd% certificate.p12
echo ">>> building com.pype"
.\ZXPSignCmd -sign com.pype/ pype.zxp certificate.p12 %pwd%
echo ">>> building com.pype.rename"
.\ZXPSignCmd -sign com.pype.rename/ pype_rename.zxp certificate.p12 %pwd%
echo ">>> installing com.pype"
.\ExManCmd.exe /install .\pype.zxp
echo ">>> installing com.pype.rename"
.\ExManCmd.exe /install .\pype_rename.zxp

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ExtensionList>
<Extension Id="com.pype.rename">
<HostList>
<Host Name="PPRO" Port="7776"/>
</HostList>
</Extension>
</ExtensionList>

View file

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-. == [ part 0f PyPE CluB ] == .-
_______________.___._____________________
\______ \__ | |\______ \_ _____/
| ___// | | | ___/| __)_
| | \____ | | | | \
|____| / ______| |____| /_______ /
\/ \/
.. __/ CliP R3N4M3R \__ ..
-->
<ExtensionManifest Version="5.0" ExtensionBundleId="com.pype.rename" ExtensionBundleVersion="0.1.0"
ExtensionBundleName="Pype Rename dialog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtensionList>
<Extension Id="com.pype.rename" Version="0.1.0" />
</ExtensionList>
<ExecutionEnvironment>
<HostList>
<Host Name="PPRO" Version="9.0" />
</HostList>
<LocaleList>
<Locale Code="All" />
</LocaleList>
<RequiredRuntimeList>
<RequiredRuntime Name="CSXS" Version="6.0" />
</RequiredRuntimeList>
</ExecutionEnvironment>
<DispatchInfoList>
<Extension Id="com.pype.rename">
<DispatchInfo >
<Resources>
<MainPath>./index.html</MainPath>
<ScriptPath>./jsx/PypeRename.jsx</ScriptPath>
<CEFCommandLine>
<Parameter>--allow-file-access</Parameter>
<Parameter>--allow-file-access-from-files</Parameter>
<Parameter>--mixed-context</Parameter>
</CEFCommandLine>
</Resources>
<Lifecycle>
<AutoVisible>true</AutoVisible>
</Lifecycle>
<UI>
<Type>Panel</Type>
<Menu>Pype Rename</Menu>
<Geometry>
<Size>
<Height>550</Height>
<Width>400</Width>
</Size>
</Geometry>
</UI>
</DispatchInfo>
</Extension>
</DispatchInfoList>
</ExtensionManifest>

View file

@ -1,40 +0,0 @@
# Pype timeline items renamer
This panel is used to rename selected clips on timeline. It is not directly interconnected with **Avalon** so it can be used separately. It has several different modes:
### Sequential Rename with Hierarchy
This mode uses tokens as `{folder}`, `{episode}` and `{sequence}` to rename clips along with numeric padding pattern `####`. Value for this tokens is filled in input boxes. If value is left empty, token is ignored. Those values are also stored in clips properties, so even if token is not used in clip name, it will be stored in clip property (and then used to create hierarchy when publishing into **Avalon**). `####` pattern can be arbitrary long, but is mandatory.
Example:
```
{folder}_{episode}_{sequence}_#####
```
Will result in `f01_ep01_sq01_0010` if respective tokens are set to these values. If folder token value isn't set result will be `_ep01_sq01_0010`.
Clip numbering can be adjusted by **Start #** and **Increment** fields. Setting start to **10** and increment to **10** with number padding pattern **####** will result in clip number **0010** for first clip, **0020** for second and so on.
### Sequential Rename
Is same as the one above, except not using tokens.
### Simple Rename
This will rename shot to new specified name. If `{shot}` token is used, it will reference current clip name. So if current clip name is `clip01` and we specify new name as `{shot}_foo`, result will be **clip01_foo**.
### Find and replace
Classic find and replace mode, using `{shot}` token as the mode above.
### Match sequence
Is not implemented yet.
### Clip Rename
Will name clip based on filename without extension.
### Change Case
This will change case of clip name to `UPPER` or `lower` case.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,3 +0,0 @@
body{background-color:#323238;color:#eeeeee}.pane{display:none}.dark>.list-group-item{background:#454747}#output{background:#212121;color:#aaaaaa;font-family:monospace;padding:2em;font-weight:bold;min-height:6em;margin-top:1em}.small-font{font-size:0.85em}
/*# sourceMappingURL=renamer.min.css.map */

View file

@ -1,9 +0,0 @@
{
"version": 3,
"file": "renamer.min.css",
"sources": [
"renamer.scss"
],
"names": [],
"mappings": "AAAA,AAAA,IAAI,AAAC,CACH,gBAAgB,CAAE,OAAO,CACzB,KAAK,CAAE,OAAO,CACf,AAED,AAAA,KAAK,AAAC,CACJ,OAAO,CAAE,IAAI,CACd,AAED,AAAA,KAAK,CAAG,gBAAgB,AAAC,CACvB,UAAU,CAAE,OAAO,CACpB,AAED,AAAA,OAAO,AAAC,CACN,UAAU,CAAE,OAAO,CACnB,KAAK,CAAE,OAAO,CACd,WAAW,CAAE,SAAS,CACtB,OAAO,CAAE,GAAG,CACZ,WAAW,CAAE,IAAI,CACjB,UAAU,CAAE,GAAG,CACf,UAAU,CAAE,GAAG,CAChB,AAED,AAAA,WAAW,AAAC,CACV,SAAS,CAAE,MAAM,CAClB"
}

View file

@ -1,26 +0,0 @@
body {
background-color: #323238;
color: #eeeeee;
}
.pane {
display: none;
}
.dark > .list-group-item {
background: #454747;
}
#output {
background: #212121;
color: #aaaaaa;
font-family: monospace;
padding: 2em;
font-weight: bold;
min-height: 6em;
margin-top: 1em;
}
.small-font {
font-size: 0.85em;
}

View file

@ -1,205 +0,0 @@
<!DOCTYPE html>
<!--
-. == [ part 0f PyPE CluB ] == .-
_______________.___._____________________
\______ \__ | |\______ \_ _____/
| ___// | | | ___/| __)_
| | \____ | | | | \
|____| / ______| |____| /_______ /
\/ \/
.. __/ CliP R3N4M3R \__ ..
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Pype Renamer</title>
<link href="./css/bootstrap.min.css" type="text/css" rel="stylesheet">
<link href="./css/renamer.min.css" type="text/css" rel="stylesheet">
<script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
<script src="./lib/jquery-3.3.1.min.js"></script>
<script src="./lib/CSInterface.js"></script>
<script src="./lib/popper.min.js"></script>
<script src="./lib/bootstrap.min.js"></script>
<script>
if (window.module) module = window.module;
</script>
</head>
<body>
<div class="container small-font">
<h5>Clip renamer</h5>
<!--
<p>
You can use tokens like:
<ol>
<li>{clip} &mdash; will correspond to original clip name</li>
<li>{shot} &mdash; if available in context, will be shot name in avalon</li>
<li>{#} &mdash; can be used to reference Avalon context if present</l>
</ol>
<div id="avalon-context">episodes/ep101/sq01</div>
"AVALON_HIERARCHY":"episodes/ep101/sq01"
</p>
-->
<div class="dropdown" id="renamer-modes">
<button class="btn btn-secondary btn-sm dropdown-toggle"
type="button" id="renamerDropdown"
data-toggle="dropdown"
data-mode="seqRenameHierarchy"
aria-haspopup="true"
aria-expanded="false">
Sequential Rename With hierarchy
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" data-mode="seqRenameHierarchy" href="#">Sequential Rename With hierarchy</a>
<a class="dropdown-item" data-mode="seqRename" href="#">Sequential Rename</a>
<a class="dropdown-item" data-mode="simpleRename" href="#">Simple Rename</a>
<a class="dropdown-item" data-mode="findAndReplace" href="#">Find and Replace</a>
<a class="dropdown-item" data-mode="matchSequence" href="#">Match Sequence</a>
<a class="dropdown-item" data-mode="clipRename" href="#">Clip Name</a>
<a class="dropdown-item" data-mode="changeCase" href="#">Change Case</a>
</div>
</div>
<hr />
<div class="section" id="renamer-ui">
<div id="rpane-seqRenameHierarchy" class="pane" style="display: block;">
<!-- Sequentiol Rename mode -->
<h6>Sequential Rename with Hierarchy</h6>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon10">Folder</span>
</div>
<input type="text" class="form-control" name="renamer-folder" placeholder="f01" aria-label="Folder" aria-describedby="basic-addon10" value="">
</div>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon11">Episode</span>
</div>
<input type="text" class="form-control" name="renamer-episode" placeholder="ep01" aria-label="Episode" aria-describedby="basic-addon11" value="">
</div>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon12">Sequence</span>
</div>
<input type="text" class="form-control" name="renamer-sequence" placeholder="sq01" aria-label="Sequence" aria-describedby="basic-addon12" value="">
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="renamer-parse-path">
<label class="form-check-label" for="renamer-parse-path">Parse tokens from filename</label>
</div>
<p>Use tokens of above fields to reference its value.</p>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon13">Pattern</span>
</div>
<input type="text" class="form-control" name="renamer-pattern" placeholder="{folder}_{episode}_{sequence}_####" aria-label="Pattern" aria-describedby="basic-addon13" value="{folder}_{episode}_{sequence}_####">
</div>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">Start # / Increment</span>
</div>
<input type="number" class="form-control" name="renamer-start" value="10">
<input type="number" class="form-control" name="renamer-inc" value="10">
</div>
<!--
<div class="form-check">
<input type="checkbox" disabled="disabled" class="form-check-input" id="renamer-incl-audio">
<label class="form-check-label" for="renamer-incl-audio">Include Clips From Audio Tracks</label>
</div>
-->
</div>
<div id="rpane-seqRename" class="pane">
<!-- Sequentiol Rename mode -->
<h6>Sequential Rename</h6>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon8">Pattern</span>
</div>
<input type="text" class="form-control" name="renamer-pattern" placeholder="s####" aria-label="Pattern" aria-describedby="basic-addon8" value="s####">
</div>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">Start # / Increment</span>
</div>
<input type="number" class="form-control" name="renamer-start" value="10">
<input type="number" class="form-control" name="renamer-inc" value="10">
</div>
<div class="form-check">
<input type="checkbox" disabled="disabled" class="form-check-input" id="renamer-incl-audio">
<label class="form-check-label" for="renamer-incl-audio">Include Clips From Audio Tracks</label>
</div>
</div>
<div id="rpane-simpleRename" class="pane">
<!-- Simple Rename mode -->
<h6>Simple Rename</h6>
<p>Use <strong>{shot}</strong> token to reference current clip name.
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon9">New Name</span>
</div>
<input type="text" class="form-control" name="renamer-newName" placeholder="{shot}" aria-label="Pattern" aria-describedby="basic-addon9" value="{shot}">
</div>
</div>
<div id="rpane-findAndReplace" class="pane">
<!-- Find and replace mode -->
<h6>Find and replace</h6>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">Find</span>
</div>
<input type="text" class="form-control" name="renamer-find" placeholder="{shot}" value="{shot}">
<input type="text" class="form-control" name="renamer-replace" placeholder="{shot}" value="{shot}">
<div class="input-group-append">
<span class="input-group-text">Replace</span>
</div>
</div>
</div>
<div id="rpane-matchSequence" class="pane">
<!-- Match sequence mode -->
<h6>Match sequence</h6>
<p>Not implemented yet.</p>
</div>
<div id="rpane-clipRename" class="pane">
<!-- Clip Rename mode -->
<h6>Clip Rename</h6>
<p>This will rename clip to its filename</p>
</div>
<div id="rpane-changeCase" class="pane">
<!-- Change Case mode -->
<h6>Change Case</h6>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<button class="btn btn-outline-secondary dropdown-toggle" id="renamer-caseSelect" data-mode="lowercase" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Case</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-mode="lowercase">lowercase</a>
<a class="dropdown-item" href="#" data-mode="uppercase">UPPERCASE</a>
</div>
</div>
<input type="text" class="form-control" id="renamer-case" value="lowercase" readonly="readonly" aria-label="used case">
</div>
</div>
</div>
<button id="btn-rename" type="button" class="btn btn-dark btn-sm btn-block">Rename</button>
<!-- Clip renamer END -->
</div>
<div class="container" id="output">
</div>
<script src="./lib/renamer.js"></script>
</body>
</html>

View file

@ -1,359 +0,0 @@
/* global app, XMPMeta, ExternalObject, CSXSEvent, Folder */
/* --------------------------------------
-. == [ part 0f PyPE CluB ] == .-
_______________.___._____________________
\______ \__ | |\______ \_ _____/
| ___// | | | ___/| __)_
| | \____ | | | | \
|____| / ______| |____| /_______ /
\/ \/
.. __/ CliP R3N4M3R \__ ..
*/
var renamer = {};
/**
* Sequence-rename selected clips and establish their hierarchy based upon provided
* data. Using data.folder, data.episode, data.sequence to name a clip and write
* resulting hierarchical clip data into sequence metadata via XMP.
*
* @param {Object} data - data {'folder', 'episode', 'sequence', 'pattern', 'increment', 'start'}
* @return {String} state
*/
renamer.renameSeqHierarchy = function (data) { // eslint-disable-line no-unused-vars
var sequence = app.project.activeSequence;
var selected = sequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
app.setSDKEventMessage('pattern ' + data.pattern + '\n' + 'increment ' + data.increment, 'info');
// get padding
var padPtr = RegExp('(?:.*?)(#+)(.*)');
var res = data.pattern.match(padPtr);
// res is now null if there is no padding string (###) in Pattern
// res[1] is padding string
if (!res) {
app.setSDKEventMessage('no padding string detected in pattern ' + data.pattern, 'error');
return false;
}
// convert to int
var index = parseInt(data.start);
// change padding string to zero: '####' -> '0000'
var rx = RegExp('#', 'g');
var fgexp = RegExp('{folder}', 'i');
var egexp = RegExp('{episode}', 'i');
var sgexp = RegExp('{sequence}', 'i');
var shotrg = RegExp('{shot}', 'i');
var zero = res[1].replace(rx, '0');
// iterate over selection
var metadata = renamer.getSequencePypeMetadata(sequence);
for (var c = 0; c < selected.length; c++) {
var mediaType = selected[c].mediaType;
if (mediaType === 'Audio') {
continue
}
delete metadata.clips[selected[c].name];
// convert index to string
var indexStr = '' + index;
// left-zero pad number
var padding = zero.substring(0, zero.length - indexStr.length) + indexStr;
// put name together
// replace {shot} token
selected[c].name = data.pattern.replace(shotrg, selected[c].name);
selected[c].name = selected[c].name.replace(res[1], padding);
selected[c].name = selected[c].name.replace(fgexp, data.folder);
selected[c].name = selected[c].name.replace(egexp, data.episode);
selected[c].name = selected[c].name.replace(sgexp, data.sequence);
// fill in hierarchy if set
var parents = [];
var hierarchy = [];
if (data.folder) {
parents.push({
'entityType': 'folder',
'entityName': data.folder
});
hierarchy.push(data.folder);
}
if (data.episode) {
parents.push({
'entityType': 'episode',
'entityName': data.episode
});
hierarchy.push(data.episode);
}
if (data.sequence) {
parents.push({
'entityType': 'sequence',
'entityName': data.sequence
});
hierarchy.push(data.sequence);
}
// push it to metadata
metadata.clips[selected[c].name] = {
'parents': parents,
'hierarchy': hierarchy.join('/'),
};
// add increment
index = index + parseInt(data.increment);
}
renamer.setSequencePypeMetadata(sequence, metadata);
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Sequence rename seleced clips
* @param {Object} data - {pattern, start, increment}
*/
renamer.renameSeq = function (data) { // eslint-disable-line no-unused-vars
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
app.setSDKEventMessage('pattern ' + data.pattern + '\n' + 'increment ' + data.increment, 'info');
// get padding
var padPtr = RegExp('(?:.*?)(#+)(?:.*)');
var res = data.pattern.match(padPtr);
// res is now null if there is no padding string (###) in Pattern
// res[1] is padding string
if (!res) {
app.setSDKEventMessage('no padding string detected in pattern ' + data.pattern, 'error');
return false;
}
// convert to int
var index = parseInt(data.start);
// change padding string to zero: '####' -> '0000'
var rx = RegExp('#', 'g');
var zero = res[2].replace(rx, '0');
// iterate over selection
for (var c = 0; c < selected.length; c++) {
// convert index to string
var indexStr = '' + index;
// left-zero pad number
var padding = zero.substring(0, zero.length - indexStr.length) + indexStr;
// put name together
selected[c].name = data.pattern.replace(res[1], padding);
// add increment
index = index + parseInt(data.increment);
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Simple rename clips
* @param {string} newName - new clip name. `{shot}` designates current clip name
* @return {string} result - return stringified JSON status
*/
renamer.renameSimple = function (newName) { // eslint-disable-line no-unused-vars
app.setSDKEventMessage('Replacing with pattern ' + newName, 'info');
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
var rx = RegExp('{shot}', 'i');
for (var c = 0; c < selected.length; c++) {
// find {shot} token and replace it with existing clip name
selected[c].name = newName.replace(rx, selected[c].name);
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Find string in clip name and replace it with another
* @param {Object} data - {find, replaceWith} object
* @return {string} result - return stringified JSON status
*/
renamer.renameFindReplace = function (data) { // eslint-disable-line no-unused-vars
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
var rx = RegExp('{shot}', 'i');
for (var c = 0; c < selected.length; c++) {
// replace {shot} token with actual clip name
var find = data.find.replace(rx, selected[c].name);
var repl = data.replaceWith.replace(rx, selected[c].name);
// replace find with replaceWith
selected[c].name = selected[c].name.replace(find, repl);
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Replace current clip name with filename (without extension)
* @return {string} result - return stringified JSON status
*/
renamer.renameClipRename = function () { // eslint-disable-line no-unused-vars
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
var regexp = new RegExp('.[^/.]+$');
for (var c = 0; c < selected.length; c++) {
// suddenly causes syntax error on regexp? So using explicit contructor
// regexp above.
// selected[c].name = selected[c].projectItem.name.replace(/\.[^/.]+$/, '');
selected[c].name = selected[c].projectItem.name.replace(regexp, '');
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Change clip name to lower or upper case
* @param {int} case - 0 lower, 1 upper
* @return {string} result - return stringified JSON status
*/
renamer.renameChangeCase = function (caseMode) { // eslint-disable-line no-unused-vars
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
for (var c = 0; c < selected.length; c++) {
if (caseMode === 0) {
selected[c].name = selected[c].name.toLowerCase();
} else {
selected[c].name = selected[c].name.toUpperCase();
}
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Set Pype metadata into sequence metadata using XMP.
* This is `hackish` way to get over premiere lack of addressing unique clip on timeline,
* so we cannot store data directly per clip.
*
* @param {Object} sequence - sequence object
* @param {Object} data - to be serialized and saved
*/
renamer.setSequencePypeMetadata = function (sequence, data) { // eslint-disable-line no-unused-vars
var kPProPrivateProjectMetadataURI = 'http://ns.adobe.com/premierePrivateProjectMetaData/1.0/';
var metadata = sequence.projectItem.getProjectMetadata();
var pypeData = 'pypeData';
var xmp = new XMPMeta(metadata);
var dataJSON = JSON.stringify(data);
app.project.addPropertyToProjectMetadataSchema(pypeData, 'Pype Data', 2);
xmp.setProperty(kPProPrivateProjectMetadataURI, pypeData, dataJSON);
var str = xmp.serialize();
sequence.projectItem.setProjectMetadata(str, [pypeData]);
// test
var newMetadata = sequence.projectItem.getProjectMetadata();
var newXMP = new XMPMeta(newMetadata);
var found = newXMP.doesPropertyExist(kPProPrivateProjectMetadataURI, pypeData);
if (!found) {
app.setSDKEventMessage('metadata not set', 'error');
}
};
/**
* Get Pype metadata from sequence using XMP.
* @param {Object} sequence
* @return {Object}
*/
renamer.getSequencePypeMetadata = function (sequence) { // eslint-disable-line no-unused-vars
var kPProPrivateProjectMetadataURI = 'http://ns.adobe.com/premierePrivateProjectMetaData/1.0/';
var metadata = sequence.projectItem.getProjectMetadata();
var pypeData = 'pypeData';
var pypeDataN = 'Pype Data';
var xmp = new XMPMeta(metadata);
app.project.addPropertyToProjectMetadataSchema(pypeData, pypeDataN, 2);
var pypeDataValue = xmp.getProperty(kPProPrivateProjectMetadataURI, pypeData);
if (pypeDataValue === undefined) {
var metadata = {
clips: {},
tags: {}
};
renamer.setSequencePypeMetadata(sequence, metadata);
pypeDataValue = xmp.getProperty(kPProPrivateProjectMetadataURI, pypeData);
return renamer.getSequencePypeMetadata(sequence);
} else {
return JSON.parse(pypeDataValue);
}
};
function keepExtension() {
return app.setExtensionPersistent('com.pype.rename', 0);
}
/**
* Dispatch event with new selection
*/
renamer.activeSequenceSelectionChanged = function () {
var sel = app.project.activeSequence.getSelection();
var selection = [];
for (var i = 0; i < sel.length; i++) {
if (sel[i].name !== 'anonymous') {
selection.push({
'name': sel[i].name,
'path': sel[i].projectItem.getMediaPath()
});
}
}
var eoName;
if (Folder.fs === 'Macintosh') {
eoName = 'PlugPlugExternalObject';
} else {
eoName = 'PlugPlugExternalObject.dll';
}
var mylib = new ExternalObject('lib:' + eoName);
var eventObj = new CSXSEvent();
eventObj.type = 'activeSequenceSelectionChanged';
eventObj.data = JSON.stringify(selection);
eventObj.dispatch();
// app.setSDKEventMessage('selection changed', 'info');
};
/**
* Register active selection event dispatching
*/
renamer.registerActiveSelectionChanged = function () {
var success = app.bind('onActiveSequenceSelectionChanged', renamer.activeSequenceSelectionChanged);
return success;
};
keepExtension();
// load the XMPScript library
if (ExternalObject.AdobeXMPScript === undefined) {
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
}
// var seq = app.project.activeSequence;
// renamer.getSequencePypeMetadata(seq);

View file

@ -1,699 +0,0 @@
/**************************************************************************************************
*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2013 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*
**************************************************************************************************/
// This is the JavaScript code for bridging to native functionality
// See CEPEngine_extensions.cpp for implementation of native methods.
//
// Note: So far all native file i/o functions are synchronous, and aynchronous file i/o is TBD.
/** Version v8.0.0 */
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*global define, native */
var cep;
if (!cep) {
cep = {};
}
if (!cep.fs) {
cep.fs = {};
}
if (!cep.process) {
cep.process = {};
}
if (!cep.encoding) {
cep.encoding = {};
}
if (!cep.util) {
cep.util = {};
}
(function () {
// Internal function to get the last error code.
native function GetLastError();
function getLastError() {
return GetLastError();
}
function getErrorResult(){
var result = {err: getLastError()};
return result;
}
// Error values. These MUST be in sync with the error values
// at the top of CEPEngine_extensions.cpp
/**
* @constant No error.
*/
cep.fs.NO_ERROR = 0;
/**
* @constant Unknown error occurred.
*/
cep.fs.ERR_UNKNOWN = 1;
/**
* @constant Invalid parameters passed to function.
*/
cep.fs.ERR_INVALID_PARAMS = 2;
/**
* @constant File or directory was not found.
*/
cep.fs.ERR_NOT_FOUND = 3;
/**
* @constant File or directory could not be read.
*/
cep.fs.ERR_CANT_READ = 4;
/**
* @constant An unsupported encoding value was specified.
*/
cep.fs.ERR_UNSUPPORTED_ENCODING = 5;
/**
* @constant File could not be written.
*/
cep.fs.ERR_CANT_WRITE = 6;
/**
* @constant Target directory is out of space. File could not be written.
*/
cep.fs.ERR_OUT_OF_SPACE = 7;
/**
* @constant Specified path does not point to a file.
*/
cep.fs.ERR_NOT_FILE = 8;
/**
* @constant Specified path does not point to a directory.
*/
cep.fs.ERR_NOT_DIRECTORY = 9;
/**
* @constant Specified file already exists.
*/
cep.fs.ERR_FILE_EXISTS = 10;
/**
* @constant The maximum number of processes has been exceeded.
*/
cep.process.ERR_EXCEED_MAX_NUM_PROCESS = 101;
/**
* @constant Invalid URL.
*/
cep.util.ERR_INVALID_URL = 201;
/**
* @constant deprecated API.
*/
cep.util.DEPRECATED_API = 202;
/**
* @constant UTF8 encoding type.
*/
cep.encoding.UTF8 = "UTF-8";
/**
* @constant Base64 encoding type.
*/
cep.encoding.Base64 = "Base64";
/**
* Displays the OS File Open dialog, allowing the user to select files or directories.
*
* @param allowMultipleSelection {boolean} When true, multiple files/folders can be selected.
* @param chooseDirectory {boolean} When true, only folders can be selected. When false, only
* files can be selected.
* @param title {string} Title of the open dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected. Ignored when chooseDirectory=true.
*
* @return An object with these properties:
* <ul><li>"data": An array of the full names of the selected files.</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowOpenDialog();
cep.fs.showOpenDialog = function (allowMultipleSelection, chooseDirectory, title, initialPath, fileTypes) {
var resultString = ShowOpenDialog(allowMultipleSelection, chooseDirectory,
title || 'Open', initialPath || '',
fileTypes ? fileTypes.join(' ') : '');
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Displays the OS File Open dialog, allowing the user to select files or directories.
*
* @param allowMultipleSelection {boolean} When true, multiple files/folders can be selected.
* @param chooseDirectory {boolean} When true, only folders can be selected. When false, only
* files can be selected.
* @param title {string} Title of the open dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected. Ignored when chooseDirectory=true.
* @param friendlyFilePrefix {string} String to put in front of the extensions
* of files that can be selected. Ignored when chooseDirectory=true. (win only)
* For example:
* fileTypes = ["gif", "jpg", "jpeg", "png", "bmp", "webp", "svg"];
* friendlyFilePrefix = "Images (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.webp;*.svg)";
* @param prompt {string} String for OK button (mac only, default is "Open" on mac, "Open" or "Select Folder" on win).
*
* @return An object with these properties:
* <ul><li>"data": An array of the full names of the selected files.</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowOpenDialogEx();
cep.fs.showOpenDialogEx = function (allowMultipleSelection, chooseDirectory, title, initialPath, fileTypes,
friendlyFilePrefix, prompt) {
var resultString = ShowOpenDialogEx(allowMultipleSelection, chooseDirectory,
title || 'Open', initialPath || '',
fileTypes ? fileTypes.join(' ') : '', friendlyFilePrefix || '',
prompt || '');
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Displays the OS File Save dialog, allowing the user to type in a file name.
*
* @param title {string} Title of the save dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected.
* @param defaultName {string} String to start with for the file name.
* @param friendlyFilePrefix {string} String to put in front of the extensions of files that can be selected. (win only)
* For example:
* fileTypes = ["gif", "jpg", "jpeg", "png", "bmp", "webp", "svg"];
* friendlyFilePrefix = "Images (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.webp;*.svg)";
* @param prompt {string} String for Save button (mac only, default is "Save" on mac and win).
* @param nameFieldLabel {string} String displayed in front of the file name text field (mac only, "File name:" on win).
*
* @return An object with these properties:
* <ul><li>"data": The file path selected to save at or "" if canceled</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowSaveDialogEx();
cep.fs.showSaveDialogEx = function (title, initialPath, fileTypes, defaultName, friendlyFilePrefix, prompt, nameFieldLabel) {
var resultString = ShowSaveDialogEx(title || '', initialPath || '',
fileTypes ? fileTypes.join(' ') : '', defaultName || '',
friendlyFilePrefix || '', prompt || '', nameFieldLabel || '');
var result = {data: resultString || '', err: getLastError() };
return result;
};
/**
* Reads the contents of a folder.
*
* @param path {string} The path of the folder to read.
*
* @return An object with these properties:
* <ul><li>"data": An array of the names of the contained files (excluding '.' and '..'.</li>
* <li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_CANT_READ </li></ul>
**/
native function ReadDir();
cep.fs.readdir = function (path) {
var resultString = ReadDir(path);
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Creates a new folder.
*
* @param path {string} The path of the folder to create.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function MakeDir();
cep.fs.makedir = function (path) {
MakeDir(path);
return getErrorResult();
};
/**
* Renames a file or folder.
*
* @param oldPath {string} The old name of the file or folder.
* @param newPath {string} The new name of the file or folder.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_FILE_EXISTS </li></ul>
**/
native function Rename();
cep.fs.rename = function(oldPath, newPath) {
Rename(oldPath, newPath);
return getErrorResult();
};
/**
* Reports whether an item is a file or folder.
*
* @param path {string} The path of the file or folder.
*
* @return An object with these properties:
* <ul><li>"data": An object with properties
* <br>isFile (boolean)
* <br>isDirectory (boolean)
* <br>mtime (modification DateTime) </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND </li>
* </ul>
**/
native function IsDirectory();
native function GetFileModificationTime();
cep.fs.stat = function (path) {
var isDir = IsDirectory(path);
var modtime = GetFileModificationTime(path);
var result = {
data: {
isFile: function () {
return !isDir;
},
isDirectory: function () {
return isDir;
},
mtime: modtime
},
err: getLastError()
};
return result;
};
/**
* Reads the entire contents of a file.
*
* @param path {string} The path of the file to read.
* @param encoding {string} The encoding of the contents of file, one of
* UTF8 (the default) or Base64.
*
* @return An object with these properties:
* <ul><li>"data": The file contents. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_CANT_READ
* <br>ERR_UNSUPPORTED_ENCODING </li>
* </ul>
**/
native function ReadFile();
cep.fs.readFile = function (path, encoding) {
encoding = encoding ? encoding : cep.encoding.UTF8;
var contents = ReadFile(path, encoding);
var result = {data: contents, err: getLastError() };
return result;
};
/**
* Writes data to a file, replacing the file if it already exists.
*
* @param path {string} The path of the file to write.
* @param data {string} The data to write to the file.
* @param encoding {string} The encoding of the contents of file, one of
* UTF8 (the default) or Base64.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_UNSUPPORTED_ENCODING
* <br>ERR_CANT_WRITE
* <br>ERR_OUT_OF_SPACE </li></ul>
**/
native function WriteFile();
cep.fs.writeFile = function (path, data, encoding) {
encoding = encoding ? encoding : cep.encoding.UTF8;
WriteFile(path, data, encoding);
return getErrorResult();
};
/**
* Sets permissions for a file or folder.
*
* @param path {string} The path of the file or folder.
* @param mode {number} The permissions in numeric format (for example, 0777).
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_CANT_WRITE </li></ul>
**/
native function SetPosixPermissions();
cep.fs.chmod = function (path, mode) {
SetPosixPermissions(path, mode);
return getErrorResult();
};
/**
* Deletes a file.
*
* @param path {string} The path of the file to delete.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_NOT_FILE </li></ul>
**/
native function DeleteFileOrDirectory();
native function IsDirectory();
cep.fs.deleteFile = function (path) {
if (IsDirectory(path)) {
var result = {err: cep.fs.ERR_NOT_FILE};
return result;
}
DeleteFileOrDirectory(path);
return getErrorResult();
};
/**
* Creates a process.
*
* @param arguments {list} The arguments to create process. The first one is the full path of the executable,
* followed by the arguments of the executable.
*
* @return An object with these properties:
* <ul><li>"data": The pid of the process, or -1 on error. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_EXCEED_MAX_NUM_PROCESS
* <br>ERR_NOT_FOUND
* <br>ERR_NOT_FILE</li>
* </ul>
**/
native function CreateProcess();
cep.process.createProcess = function () {
var args = Array.prototype.slice.call(arguments);
var pid = CreateProcess(args);
var result = {data: pid, err: getLastError()};
return result;
};
/**
* Registers a standard-output handler for a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function for the standard output callback.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function SetupStdOutHandler();
cep.process.stdout = function (pid, callback) {
SetupStdOutHandler(pid, callback);
return getErrorResult();
};
/**
* Registers up a standard-error handler for a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function for the standard error callback.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function SetupStdErrHandler();
cep.process.stderr = function (pid, callback) {
SetupStdErrHandler(pid, callback);
return getErrorResult();
};
/**
* Writes data to the standard input of a process.
*
* @param pid {int} The pid of the process
* @param data {string} The data to write.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function WriteStdIn();
cep.process.stdin = function (pid, data) {
WriteStdIn(pid, data);
return getErrorResult();
};
/**
* Retrieves the working directory of a process.
*
* @param pid {int} The pid of the process.
*
* @return An object with these properties:
* <ul><li>"data": The path of the working directory. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function GetWorkingDirectory();
cep.process.getWorkingDirectory = function (pid) {
var wd = GetWorkingDirectory(pid);
var result = {data: wd, err: getLastError()};
return result;
};
/**
* Waits for a process to quit.
*
* @param pid {int} The pid of the process.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function WaitFor();
cep.process.waitfor = function (pid) {
WaitFor(pid);
return getErrorResult();
};
/**
* Registers a handler for the onquit callback of a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function OnQuit();
cep.process.onquit = function (pid, callback) {
OnQuit(pid, callback);
return getErrorResult();
};
/**
* Reports whether a process is currently running.
*
* @param pid {int} The pid of the process.
*
* @return An object with these properties:
* <ul><li>"data": True if the process is running, false otherwise. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function IsRunning();
cep.process.isRunning = function (pid) {
var isRunning = IsRunning(pid);
var result = {data: isRunning, err: getLastError()};
return result;
};
/**
* Terminates a process.
*
* @param pid {int} The pid of the process
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function Terminate();
cep.process.terminate = function (pid) {
Terminate(pid);
return getErrorResult();
};
/**
* Encoding conversions.
*
*/
cep.encoding.convertion =
{
utf8_to_b64: function(str) {
return window.btoa(unescape(encodeURIComponent(str)));
},
b64_to_utf8: function(base64str) {
// If a base64 string contains any whitespace character, DOM Exception 5 occurs during window.atob, please see
// http://stackoverflow.com/questions/14695988/dom-exception-5-invalid-character-error-on-valid-base64-image-string-in-javascri
base64str = base64str.replace(/\s/g, '');
return decodeURIComponent(escape(window.atob(base64str)));
},
binary_to_b64: function(binary) {
return window.btoa(binary);
},
b64_to_binary: function(base64str) {
return window.atob(base64str);
},
ascii_to_b64: function(ascii) {
return window.btoa(binary);
},
b64_to_ascii: function(base64str) {
return window.atob(base64str);
}
};
/**
* Opens a page in the default system browser.
*
* @param url {string} The URL of the page/file to open, or the email address.
* Must use HTTP/HTTPS/file/mailto. For example:
* "http://www.adobe.com"
* "https://github.com"
* "file:///C:/log.txt"
* "mailto:test@adobe.com"
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function OpenURLInDefaultBrowser();
cep.util.openURLInDefaultBrowser = function (url) {
if (url && (url.indexOf("http://") === 0 ||
url.indexOf("https://") === 0 ||
url.indexOf("file://") === 0 ||
url.indexOf("mailto:") === 0)) {
OpenURLInDefaultBrowser(url);
return getErrorResult();
} else {
return { err : cep.util.ERR_INVALID_URL };
}
};
/**
* Registers a callback function for extension unload. If called more than once,
* the last callback that is successfully registered is used.
*
* @deprecated since version 6.0.0
*
* @param callback {function} The handler function.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function RegisterExtensionUnloadCallback();
cep.util.registerExtensionUnloadCallback = function (callback) {
return { err : cep.util.DEPRECATED_API };
};
/**
* Stores the user's proxy credentials
*
* @param username {string} proxy username
* @param password {string} proxy password
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function StoreProxyCredentials();
cep.util.storeProxyCredentials = function (username, password) {
StoreProxyCredentials(username, password);
return getErrorResult();
};
})();

View file

@ -1,459 +0,0 @@
/**************************************************************************************************
*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2013 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*
**************************************************************************************************/
/** Vulcan - v9.2.0 */
/**
* @class Vulcan
*
* The singleton instance, <tt>VulcanInterface</tt>, provides an interface
* to the Vulcan. Allows you to launch CC applications
* and discover information about them.
*/
function Vulcan()
{
}
/**
* Gets all available application specifiers on the local machine.
*
* @return The array of all available application specifiers.
*/
Vulcan.prototype.getTargetSpecifiers = function()
{
var params = {};
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetTargetSpecifiers", JSON.stringify(params)));
};
/**
* Launches a CC application on the local machine, if it is not already running.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @param focus True to launch in foreground, or false to launch in the background.
* @param cmdLine Optional, command-line parameters to supply to the launch command.
* @return True if the app can be launched, false otherwise.
*/
Vulcan.prototype.launchApp = function(targetSpecifier, focus, cmdLine)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
params.focus = focus ? "true" : "false";
params.cmdLine = requiredParamsValid(cmdLine) ? cmdLine : "";
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanLaunchApp", JSON.stringify(params))).result;
};
/**
* Checks whether a CC application is running on the local machine.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return True if the app is running, false otherwise.
*/
Vulcan.prototype.isAppRunning = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppRunning", JSON.stringify(params))).result;
};
/**
* Checks whether a CC application is installed on the local machine.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return True if the app is installed, false otherwise.
*/
Vulcan.prototype.isAppInstalled = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppInstalled", JSON.stringify(params))).result;
};
/**
* Retrieves the local install path of a CC application.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return The path string if the application is found, "" otherwise.
*/
Vulcan.prototype.getAppPath = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return "";
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetAppPath", JSON.stringify(params))).result;
};
/**
* Registers a message listener callback function for a Vulcan message.
*
* @param type The message type.
* @param callback The callback function that handles the message.
* Takes one argument, the message object.
* @param obj Optional, the object containing the callback method, if any.
* Default is null.
*/
Vulcan.prototype.addMessageListener = function(type, callback, obj)
{
if(!requiredParamsValid(type, callback) || !strStartsWith(type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
params.type = type;
window.__adobe_cep__.invokeAsync("vulcanAddMessageListener", JSON.stringify(params), callback, obj);
};
/**
* Removes a registered message listener callback function for a Vulcan message.
*
* @param type The message type.
* @param callback The callback function that was registered.
* Takes one argument, the message object.
* @param obj Optional, the object containing the callback method, if any.
* Default is null.
*/
Vulcan.prototype.removeMessageListener = function(type, callback, obj)
{
if(!requiredParamsValid(type, callback) || !strStartsWith(type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
params.type = type;
window.__adobe_cep__.invokeAsync("vulcanRemoveMessageListener", JSON.stringify(params), callback, obj);
};
/**
* Dispatches a Vulcan message.
*
* @param vulcanMessage The message object.
*/
Vulcan.prototype.dispatchMessage = function(vulcanMessage)
{
if(!requiredParamsValid(vulcanMessage) || !strStartsWith(vulcanMessage.type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
var message = new VulcanMessage(vulcanMessage.type);
message.initialize(vulcanMessage);
params.vulcanMessage = message;
window.__adobe_cep__.invokeSync("vulcanDispatchMessage", JSON.stringify(params));
};
/**
* Retrieves the message payload of a Vulcan message for the registered message listener callback function.
*
* @param vulcanMessage The message object.
* @return A string containing the message payload.
*/
Vulcan.prototype.getPayload = function(vulcanMessage)
{
if(!requiredParamsValid(vulcanMessage) || !strStartsWith(vulcanMessage.type, VulcanMessage.TYPE_PREFIX))
{
return null;
}
var message = new VulcanMessage(vulcanMessage.type);
message.initialize(vulcanMessage);
return message.getPayload();
};
/**
* Gets all available endpoints of the running Vulcan-enabled applications.
*
* Since 7.0.0
*
* @return The array of all available endpoints.
* An example endpoint string:
* <endPoint>
* <appId>PHXS</appId>
* <appVersion>16.1.0</appVersion>
* </endPoint>
*/
Vulcan.prototype.getEndPoints = function()
{
var params = {};
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetEndPoints", JSON.stringify(params)));
};
/**
* Gets the endpoint for itself.
*
* Since 7.0.0
*
* @return The endpoint string for itself.
*/
Vulcan.prototype.getSelfEndPoint = function()
{
var params = {};
return window.__adobe_cep__.invokeSync("vulcanGetSelfEndPoint", JSON.stringify(params));
};
/** Singleton instance of Vulcan **/
var VulcanInterface = new Vulcan();
//--------------------------------- Vulcan Message ------------------------------
/**
* @class VulcanMessage
* Message type for sending messages between host applications.
* A message of this type can be sent to the designated destination
* when appId and appVersion are provided and valid. Otherwise,
* the message is broadcast to all running Vulcan-enabled applications.
*
* To send a message between extensions running within one
* application, use the <code>CSEvent</code> type in CSInterface.js.
*
* @param type The message type.
* @param appId The peer appId.
* @param appVersion The peer appVersion.
*
*/
function VulcanMessage(type, appId, appVersion)
{
this.type = type;
this.scope = VulcanMessage.SCOPE_SUITE;
this.appId = requiredParamsValid(appId) ? appId : VulcanMessage.DEFAULT_APP_ID;
this.appVersion = requiredParamsValid(appVersion) ? appVersion : VulcanMessage.DEFAULT_APP_VERSION;
this.data = VulcanMessage.DEFAULT_DATA;
}
VulcanMessage.TYPE_PREFIX = "vulcan.SuiteMessage.";
VulcanMessage.SCOPE_SUITE = "GLOBAL";
VulcanMessage.DEFAULT_APP_ID = "UNKNOWN";
VulcanMessage.DEFAULT_APP_VERSION = "UNKNOWN";
VulcanMessage.DEFAULT_DATA = "<data><payload></payload></data>";
VulcanMessage.dataTemplate = "<data>{0}</data>";
VulcanMessage.payloadTemplate = "<payload>{0}</payload>";
/**
* Initializes this message instance.
*
* @param message A \c message instance to use for initialization.
*/
VulcanMessage.prototype.initialize = function(message)
{
this.type = message.type;
this.scope = message.scope;
this.appId = message.appId;
this.appVersion = message.appVersion;
this.data = message.data;
};
/**
* Retrieves the message data.
*
* @return A data string in XML format.
*/
VulcanMessage.prototype.xmlData = function()
{
if(this.data === undefined)
{
var str = "";
str = String.format(VulcanMessage.payloadTemplate, str);
this.data = String.format(VulcanMessage.dataTemplate, str);
}
return this.data;
};
/**
* Sets the message payload of this message.
*
* @param payload A string containing the message payload.
*/
VulcanMessage.prototype.setPayload = function(payload)
{
var str = cep.encoding.convertion.utf8_to_b64(payload);
str = String.format(VulcanMessage.payloadTemplate, str);
this.data = String.format(VulcanMessage.dataTemplate, str);
};
/**
* Retrieves the message payload of this message.
*
* @return A string containing the message payload.
*/
VulcanMessage.prototype.getPayload = function()
{
var str = GetValueByKey(this.data, "payload");
if(str !== null)
{
return cep.encoding.convertion.b64_to_utf8(str);
}
return null;
};
/**
* Converts the properties of this instance to a string.
*
* @return The string version of this instance.
*/
VulcanMessage.prototype.toString = function()
{
var str = "type=" + this.type;
str += ", scope=" + this.scope;
str += ", appId=" + this.appId;
str += ", appVersion=" + this.appVersion;
str += ", data=" + this.xmlData();
return str;
};
//--------------------------------------- Util --------------------------------
/**
* Formats a string based on a template.
*
* @param src The format template.
*
* @return The formatted string
*/
String.format = function(src)
{
if (arguments.length === 0)
{
return null;
}
var args = Array.prototype.slice.call(arguments, 1);
return src.replace(/\{(\d+)\}/g, function(m, i){
return args[i];
});
};
/**
* Retrieves the content of an XML element.
*
* @param xmlStr The XML string.
* @param key The name of the tag.
*
* @return The content of the tag, or the empty string
* if such tag is not found or the tag has no content.
*/
function GetValueByKey(xmlStr, key)
{
if(window.DOMParser)
{
var parser = new window.DOMParser();
try
{
var xmlDoc = parser.parseFromString(xmlStr, "text/xml");
var node = xmlDoc.getElementsByTagName(key)[0];
if(node && node.childNodes[0])
{
return node.childNodes[0].nodeValue;
}
}
catch(e)
{
//log the error
}
}
return "";
}
/**
* Reports whether required parameters are valid.
*
* @return True if all required parameters are valid,
* false if any of the required parameters are invalid.
*/
function requiredParamsValid()
{
for(var i = 0; i < arguments.length; i++)
{
var argument = arguments[i];
if(argument === undefined || argument === null)
{
return false;
}
}
return true;
}
/**
* Reports whether a string has a given prefix.
*
* @param str The target string.
* @param prefix The specific prefix string.
*
* @return True if the string has the prefix, false if not.
*/
function strStartsWith(str, prefix)
{
if(typeof str != "string")
{
return false;
}
return str.indexOf(prefix) === 0;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,131 +0,0 @@
/* global $, CSInterface, process */
/* --------------------------------------
-. == [ part 0f PyPE CluB ] == .-
_______________.___._____________________
\______ \__ | |\______ \_ _____/
| ___// | | | ___/| __)_
| | \____ | | | | \
|____| / ______| |____| /_______ /
\/ \/
.. __/ CliP R3N4M3R \__ ..
*/
var csi = new CSInterface();
function displayResults(data) {
var con = $('#output');
con.html(data);
}
// Bind renamer controls
$('#renamer-modes a').click(function () {
var mode = $(this).data('mode');
$('#renamerDropdown').dropdown('toggle');
$('#renamerDropdown').html($(this).html());
$('#renamer-ui .pane').css('display', 'none');
$('#rpane-' + mode).css('display', 'block');
$('#renamerDropdown').data('mode', mode);
return false;
});
$('#renamer-caseSelect a').click(function () {
$('#renamer-caseSelect').data('mode', $(this).data('mode'));
return false;
});
$('#btn-rename').click(function () {
var mode = $('#renamerDropdown').data('mode');
if (!mode) {
mode = 'seqRename';
}
var data = '';
switch (mode) {
case 'seqRenameHierarchy':
data = {
'folder': $('#rpane-' + mode + ' input[name=renamer-folder]').val(),
'episode': $('#rpane-' + mode + ' input[name=renamer-episode]').val(),
'sequence': $('#rpane-' + mode + ' input[name=renamer-sequence]').val(),
'pattern': $('#rpane-' + mode + ' input[name=renamer-pattern]').val(),
'start': $('#rpane-' + mode + ' input[name=renamer-start]').val(),
'increment': $('#rpane-' + mode + ' input[name=renamer-inc]').val()
};
csi.evalScript('renamer.renameSeqHierarchy(' + JSON.stringify(data) + ');', function (result) {
displayResults(result);
});
break;
case 'seqRename':
data = {
'pattern': $('#rpane-' + mode + ' input[name=renamer-pattern]').val(),
'start': $('#rpane-' + mode + ' input[name=renamer-start]').val(),
'increment': $('#rpane-' + mode + ' input[name=renamer-inc]').val()
};
csi.evalScript('renamer.renameSeq(' + JSON.stringify(data) + ');', function (result) {
displayResults(result);
});
break;
case 'simpleRename':
data = $('#rpane-' + mode + ' input[name=renamer-newName]').val();
displayResults(data);
csi.evalScript('renamer.renameSimple("' + data + '");', function (result) {
displayResults(result);
});
break;
case 'findAndReplace':
data = {
'find': $('#rpane-' + mode + ' input[name=renamer-find]').val(),
'replaceWith': $('#rpane-' + mode + ' input[name=renamer-replace]').val()
};
csi.evalScript('renamer.renameFindReplace(' + JSON.stringify(data) + ');', function (result) {
displayResults(result);
});
break;
case 'matchSequence':
// not implemented
break;
case 'clipRename':
csi.evalScript('renamer.renameClipRename();', function (result) {
displayResults(result);
});
break;
case 'changeCase':
var stringCase = 0;
var caseMode = $('#renamer-caseSelect').data('mode');
if (caseMode === 'uppercase') {
stringCase = 1;
}
$('#renamer-case').val(caseMode);
csi.evalScript('renamer.renameChangeCase("' + stringCase + '");', function (result) {
displayResults(result);
});
break;
default:
}
});
// add selection changed addEventListener
csi.evalScript('renamer.registerActiveSelectionChanged()');
csi.addEventListener('activeSequenceSelectionChanged', function (event) {
var mode = $('#renamerDropdown').data('mode');
if (mode !== 'seqRenameHierarchy') {
return;
}
var path = event.data[0].path.split('\\');
// test if path has more then 4 elements - folder/episode/sequence/filename
if (path.length > 4) {
var folder = path[path.length - 4];
var episode = path[path.length - 3];
var sequence = path[path.length - 2];
if ($('#renamer-parse-path').prop('checked')) {
$('#rpane-' + mode + ' input[name=renamer-folder]').val(folder);
$('#rpane-' + mode + ' input[name=renamer-episode]').val(episode);
$('#rpane-' + mode + ' input[name=renamer-sequence]').val(sequence);
}
}
});

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ExtensionList>
<Extension Id="com.pype">
<HostList>
<Host Name="PPRO" Port="7766"/>
</HostList>
</Extension>
</ExtensionList>

View file

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- /************************************************************************* * ADOBE CONFIDENTIAL * ___________________ * * Copyright 2014 Adobe * All Rights Reserved. * * NOTICE: Adobe permits you to use, modify, and distribute this file in *
accordance with the terms of the Adobe license agreement accompanying * it. If you have received this file from a source other than Adobe, * then your use, modification, or distribution of it requires the prior * written permission of Adobe.
**************************************************************************/ -->
<ExtensionManifest Version="5.0" ExtensionBundleId="com.pype" ExtensionBundleVersion="11.1" ExtensionBundleName="Pype Panel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtensionList>
<Extension Id="com.pype" Version="10.3.0"/>
</ExtensionList>
<ExecutionEnvironment>
<HostList>
<Host Name="PPRO" Version="9.0"/>
</HostList>
<LocaleList>
<Locale Code="All"/>
</LocaleList>
<RequiredRuntimeList>
<RequiredRuntime Name="CSXS" Version="6.0"/>
</RequiredRuntimeList>
</ExecutionEnvironment>
<DispatchInfoList>
<Extension Id="com.pype">
<DispatchInfo >
<Resources>
<MainPath>./index_remote.html</MainPath>
<ScriptPath>./pypeApp.jsx</ScriptPath>
<CEFCommandLine>
<Parameter>--enable-nodejs</Parameter>
<Parameter>--mixed-context</Parameter>
<Parameter>--disable-application-cache</Parameter>
</CEFCommandLine>
</Resources>
<Lifecycle>
<AutoVisible>true</AutoVisible>
</Lifecycle>
<UI>
<Type>Panel</Type>
<Menu>Pype</Menu>
<Geometry>
<Size>
<Width>600</Width>
<Height>850</Height>
</Size>
</Geometry>
<Icons>
<Icon Type="Normal">./icons/iconNormal.png</Icon>
<Icon Type="RollOver">./icons/iconRollover.png</Icon>
<Icon Type="Disabled">./icons/iconDisabled.png</Icon>
<Icon Type="DarkNormal">./icons/iconDarkNormal.png</Icon>
<Icon Type="DarkRollOver">./icons/iconDarkRollover.png</Icon>
</Icons>
</UI>
</DispatchInfo>
</Extension>
</DispatchInfoList>
</ExtensionManifest>

View file

@ -1,565 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<PremiereData Version="3">
<IngestPresetUserComments></IngestPresetUserComments>
<IngestMetadataPreset></IngestMetadataPreset>
<IngestMetadataEnabled>false</IngestMetadataEnabled>
<IngestNamingPreset></IngestNamingPreset>
<IngestNamingEnabled>false</IngestNamingEnabled>
<IngestTranscodeExporterModuleName></IngestTranscodeExporterModuleName>
<IngestTranscodePresetName></IngestTranscodePresetName>
<IngestTranscodePath></IngestTranscodePath>
<IngestTranscodeEnabled>false</IngestTranscodeEnabled>
<IngestCopyVerificationType>-1</IngestCopyVerificationType>
<IngestCopyPath></IngestCopyPath>
<IngestCopyEnabled>false</IngestCopyEnabled>
<IngestPreset>false</IngestPreset>
<StandardUserFilters ObjectRef="17"/>
<ExportXMPOptionKey>10</ExportXMPOptionKey>
<StandardFilters Version="1">
<RenderAlphaOnly>false</RenderAlphaOnly>
<CustomStartTime>-101606400000000000</CustomStartTime>
<UseFrameBlending>false</UseFrameBlending>
<UsePreview>false</UsePreview>
<UseMaximumRenderQuality>false</UseMaximumRenderQuality>
<DeinterlaceState>false</DeinterlaceState>
<CropType>0</CropType>
<CropRect>0,0,0,0</CropRect>
<CropState>false</CropState>
<TimeInterpolationType>0</TimeInterpolationType>
</StandardFilters>
<FolderDisplayPath></FolderDisplayPath>
<DoEmulation>true</DoEmulation>
<DoVideo>false</DoVideo>
<DoAudio>true</DoAudio>
<PresetID>f87cf8f2-0552-4d24-b708-573836102388</PresetID>
<CaptionParamContainer ObjectRef="27"/>
<ExportParamContainer ObjectRef="1"/>
<ExporterFileType>1463899717</ExporterFileType>
<ExporterClassID>1061109567</ExporterClassID>
<ExporterName></ExporterName>
<PresetCreatorPostProc></PresetCreatorPostProc>
<PresetCreatorApp>Adobe Media Encoder</PresetCreatorApp>
<PresetUserComments></PresetUserComments>
<PresetComments>Custom</PresetComments>
<PresetName>pype_44khz16bit</PresetName>
<ExporterParamContainer ObjectID="1" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="2"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="2" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamTargetBitrate>0</ParamTargetBitrate>
<ParamTargetID>0</ParamTargetID>
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="3"/>
<ParamName></ParamName>
<ParamIdentifier>0</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>10</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="3" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="4"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="4" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="5"/>
<ParamIdentifier>ADBEAudioTabGroup</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>8</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="5" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="6"/>
<ParamContainerItem Index="1" ObjectRef="9"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="6" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="7"/>
<ParamIdentifier>ADBEAudioCodecGroup</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>8</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="7" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="8"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="8" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioCodec</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>true</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="9" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="10"/>
<ParamIdentifier>ADBEBasicAudioGroup</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>1</ParamOrdinalValue>
<ParamType>8</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="10" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="11"/>
<ParamContainerItem Index="1" ObjectRef="12"/>
<ParamContainerItem Index="2" ObjectRef="13"/>
<ParamContainerItem Index="3" ObjectRef="14"/>
<ParamContainerItem Index="4" ObjectRef="15"/>
<ParamContainerItem Index="5" ObjectRef="16"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="11" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioCodec</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>true</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="12" ClassID="d0f6b8af-8ddb-4381-acf8-3e817480d07d" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioCodecPrefsButton</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>true</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>1</ParamOrdinalValue>
<ParamType>7</ParamType>
<ParamValue>false</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="13" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioRatePerSecond</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>true</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>2</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>44100</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="14" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioNumChannels</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>true</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>3</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>2</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="15" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioSampleType</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>true</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>4</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>1</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="16" ClassID="d0f6b8af-8ddb-4381-acf8-3e817480d07d" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>SeparateMonoFiles</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>5</ParamOrdinalValue>
<ParamType>1</ParamType>
<ParamValue>false</ParamValue>
</ExporterParam>
<StandardFilterContainer ObjectID="17" ClassID="00c9f895-891b-412d-9180-38b10a29c9a8" Version="5">
<FilterCount>9</FilterCount>
<FilterItem Index="0" ObjectRef="18"/>
<FilterItem Index="1" ObjectRef="19"/>
<FilterItem Index="2" ObjectRef="20"/>
<FilterItem Index="3" ObjectRef="21"/>
<FilterItem Index="4" ObjectRef="22"/>
<FilterItem Index="5" ObjectRef="23"/>
<FilterItem Index="6" ObjectRef="24"/>
<FilterItem Index="7" ObjectRef="25"/>
<FilterItem Index="8" ObjectRef="26"/>
</StandardFilterContainer>
<StandardFilterWrapperLumetri ObjectID="18" ClassID="a3da719f-5b68-4fbe-af95-d0c3e0127e5e" Version="1">
<LoadedEffectName></LoadedEffectName>
<UiInstance>0</UiInstance>
<Enabled>false</Enabled>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperLumetri>
<StandardFilterWrapperSDRConform ObjectID="19" ClassID="1631c0b1-163d-4fb8-a3c2-f179d431cdba" Version="1">
<Contrast>0.</Contrast>
<SoftKnee>100.</SoftKnee>
<Brightness>10.</Brightness>
<UiInstance>0</UiInstance>
<Enabled>false</Enabled>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperSDRConform>
<StandardFilterWrapperOverlay ObjectID="20" ClassID="13830401-7ec6-45df-a2e1-d8f629e899b2" Version="1">
<AbsoluteSizing>false</AbsoluteSizing>
<Size>100.</Size>
<PositionY>0.</PositionY>
<PositionX>0.</PositionX>
<PositionIndex>4</PositionIndex>
<SourceFilePath></SourceFilePath>
<Opacity>100</Opacity>
<UiInstance>0</UiInstance>
<Enabled>false</Enabled>
<ReferencePixelAspectRatio>1.</ReferencePixelAspectRatio>
<ReferenceFrameHeight>0</ReferenceFrameHeight>
<ReferenceFrameWidth>0</ReferenceFrameWidth>
<PosSizeStorageVersion>1</PosSizeStorageVersion>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperOverlay>
<StandardFilterWrapperAlphaAdjust ObjectID="21" ClassID="d3391303-f3a9-4932-a3b1-3a5fcb28dfb2" Version="1">
<UiInstance>0</UiInstance>
<Enabled>true</Enabled>
<AlphaAdjust_MaskOnly>false</AlphaAdjust_MaskOnly>
<AlphaAdjust_InvertAlpha>false</AlphaAdjust_InvertAlpha>
<AlphaAdjust_IgnoreAlpha>false</AlphaAdjust_IgnoreAlpha>
<AlphaAdjust_Opacity>100.</AlphaAdjust_Opacity>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperAlphaAdjust>
<StandardFilterWrapperClipName ObjectID="22" ClassID="2cf9288f-faea-4461-ad17-89705ab2b63a" Version="1">
<AbsoluteSizing>false</AbsoluteSizing>
<Size>15.</Size>
<PositionY>0.</PositionY>
<PositionX>0.</PositionX>
<PositionIndex>1</PositionIndex>
<Opacity>40</Opacity>
<Suffix></Suffix>
<TextType>1</TextType>
<Prefix></Prefix>
<UiInstance>0</UiInstance>
<Enabled>false</Enabled>
<ReferencePixelAspectRatio>1.</ReferencePixelAspectRatio>
<ReferenceFrameHeight>0</ReferenceFrameHeight>
<ReferenceFrameWidth>0</ReferenceFrameWidth>
<PosSizeStorageVersion>1</PosSizeStorageVersion>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperClipName>
<StandardFilterWrapperTimecode ObjectID="23" ClassID="50810324-4cbd-4897-9eff-e328663a83c9" Version="1">
<Offset>0</Offset>
<GenerateTimecode>0</GenerateTimecode>
<GenerateFormat>2</GenerateFormat>
<SourceTypeIndex>0</SourceTypeIndex>
<ParameterOpacity>40</ParameterOpacity>
<AbsoluteSizing>false</AbsoluteSizing>
<Size>15.</Size>
<PositionY>0.</PositionY>
<PositionX>0.</PositionX>
<PositionIndex>7</PositionIndex>
<UiInstance>0</UiInstance>
<Enabled>false</Enabled>
<ReferencePixelAspectRatio>1.</ReferencePixelAspectRatio>
<ReferenceFrameHeight>0</ReferenceFrameHeight>
<ReferenceFrameWidth>0</ReferenceFrameWidth>
<PosSizeStorageVersion>1</PosSizeStorageVersion>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperTimecode>
<StandardFilterWrapperTimeCarving ObjectID="24" ClassID="b468411d-5d5a-4900-ad11-cd34ab0622f9" Version="2">
<SkipSlates>false</SkipSlates>
<Mode>1</Mode>
<TargetDuration>28615971384000</TargetDuration>
<CarveRatio>1.</CarveRatio>
<UiInstance>0</UiInstance>
<Enabled>false</Enabled>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperTimeCarving>
<StandardFilterWrapperVideoLimiter ObjectID="25" ClassID="767863e8-287f-4df8-b8fc-88af92dc789d" Version="2">
<ClipLevel>1</ClipLevel>
<UiInstance>0</UiInstance>
<Enabled>false</Enabled>
<GamutWarningColor>0</GamutWarningColor>
<EnableGamutWarning>false</EnableGamutWarning>
<CompressionBeforeClippingOption>0</CompressionBeforeClippingOption>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperVideoLimiter>
<StandardFilterWrapperLoudnessNormalization ObjectID="26" ClassID="39b71d0a-9f22-4b23-9f61-5600f10e7047" Version="1">
<ReleaseTime>200.</ReleaseTime>
<LookAheadTime>12.</LookAheadTime>
<TruePeakLevel>-2.</TruePeakLevel>
<TargetLoudness>-24.</TargetLoudness>
<LoudnessStandard>0</LoudnessStandard>
<UiInstance>0</UiInstance>
<Enabled>false</Enabled>
<LoudnessChannelGrouping Encoding="base64" Checksum="4018651919">eyJjdXN0b21EYXRhIjp7InVzZVNjZW5hcmlvIjoyfSwibUFsbG93ZWRDaGFubmVsTGF5b3V0VmVjdG9yIjpbW3siY2hhbm5lbGxhYmVsIjowfV0sW3siY2hhbm5lbGxhYmVsIjoxMDB9LHsiY2hhbm5lbGxhYmVsIjoxMDF9XSxbeyJjaGFubmVsbGFiZWwiOjEwMH0seyJjaGFubmVsbGFiZWwiOjEwMX0seyJjaGFubmVsbGFiZWwiOjEwMn0seyJjaGFubmVsbGFiZWwiOjEwM30seyJjaGFubmVsbGFiZWwiOjEwNH0seyJjaGFubmVsbGFiZWwiOjEwNX1dXSwibUNoYW5uZWxMYXlvdXRWZWN0b3IiOltdLCJtTWF4TnVtQXVkaW9DaGFubmVscyI6MiwibU1heE51bUF1ZGlvQ2hhbm5lbHNQZXJTdHJlYW0iOjIsIm1NYXhOdW1BdWRpb1N0cmVhbXMiOjMyLCJtVmVyc2lvbiI6MX0=</LoudnessChannelGrouping>
<CustomLoudnessReportLocation></CustomLoudnessReportLocation>
<UseCustomLoudnessReportLocation>false</UseCustomLoudnessReportLocation>
<WriteLoudnessReport>false</WriteLoudnessReport>
<UseCustomTruePeakLimiterSettings>false</UseCustomTruePeakLimiterSettings>
<LoudnessTolerance>2.</LoudnessTolerance>
<BaseStorageVersion>1</BaseStorageVersion>
</StandardFilterWrapperLoudnessNormalization>
<ExporterParamContainer ObjectID="27" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="28"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="28" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamTargetBitrate>0</ParamTargetBitrate>
<ParamTargetID>0</ParamTargetID>
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="29"/>
<ParamName>Captions</ParamName>
<ParamIdentifier>ADBECaptionTabGroup</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>10</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="29" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="30"/>
<ParamContainerItem Index="1" ObjectRef="31"/>
<ParamContainerItem Index="2" ObjectRef="32"/>
<ParamContainerItem Index="3" ObjectRef="33"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="30" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBECaptionExportOption</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>true</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="31" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBECaptionFormat</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>true</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>1</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>2</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="32" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBECaptionFrameRate</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>true</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>2</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>100</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="33" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBECaptionStreamFormat</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>true</ParamIsHidden>
<ParamIsDisabled>true</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>3</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
</PremiereData>

View file

@ -1,251 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<PremiereData Version="3">
<IngestPresetUserComments></IngestPresetUserComments>
<IngestMetadataPreset></IngestMetadataPreset>
<IngestMetadataEnabled>false</IngestMetadataEnabled>
<IngestNamingPreset></IngestNamingPreset>
<IngestNamingEnabled>false</IngestNamingEnabled>
<IngestTranscodeExporterModuleName></IngestTranscodeExporterModuleName>
<IngestTranscodePresetName></IngestTranscodePresetName>
<IngestTranscodePath></IngestTranscodePath>
<IngestTranscodeEnabled>false</IngestTranscodeEnabled>
<IngestCopyVerificationType>-1</IngestCopyVerificationType>
<IngestCopyPath></IngestCopyPath>
<IngestCopyEnabled>false</IngestCopyEnabled>
<IngestPreset>false</IngestPreset>
<ExportXMPOptionKey>10</ExportXMPOptionKey>
<StandardFilters Version="1">
<RenderAlphaOnly>false</RenderAlphaOnly>
<CustomStartTime>-101606400000000000</CustomStartTime>
<UseFrameBlending>false</UseFrameBlending>
<UsePreview>false</UsePreview>
<UseMaximumRenderQuality>false</UseMaximumRenderQuality>
<DeinterlaceState>false</DeinterlaceState>
<CropType>0</CropType>
<CropRect>0,0,0,0</CropRect>
<CropState>false</CropState>
<TimeInterpolationType>0</TimeInterpolationType>
</StandardFilters>
<FolderDisplayPath></FolderDisplayPath>
<DoEmulation>true</DoEmulation>
<DoVideo>false</DoVideo>
<DoAudio>true</DoAudio>
<PresetID>01b390cd-d5f7-4bdc-a210-43c2362f19ea</PresetID>
<ExportParamContainer ObjectRef="1"/>
<ExporterFileType>1463899717</ExporterFileType>
<ExporterClassID>1061109567</ExporterClassID>
<ExporterName></ExporterName>
<PresetCreatorPostProc></PresetCreatorPostProc>
<PresetCreatorApp></PresetCreatorApp>
<PresetUserComments></PresetUserComments>
<PresetComments></PresetComments>
<PresetName>48hz</PresetName>
<ExporterParamContainer ObjectID="1" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="2"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="2" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamTargetBitrate>0</ParamTargetBitrate>
<ParamTargetID>0</ParamTargetID>
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="3"/>
<ParamName></ParamName>
<ParamIdentifier>0</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>10</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="3" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="4"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="4" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="5"/>
<ParamIdentifier>ADBEAudioTabGroup</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>8</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="5" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="6"/>
<ParamContainerItem Index="1" ObjectRef="9"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="6" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="7"/>
<ParamIdentifier>ADBEAudioCodecGroup</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>8</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="7" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="8"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="8" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioCodec</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>true</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="9" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ExporterChildParams ObjectRef="10"/>
<ParamIdentifier>ADBEBasicAudioGroup</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>false</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>1</ParamOrdinalValue>
<ParamType>8</ParamType>
<ParamValue>0</ParamValue>
</ExporterParam>
<ExporterParamContainer ObjectID="10" ClassID="5c20a4a5-5e7c-4032-85b8-26ad4531fe7b" Version="1">
<ContainedParamsVersion>1</ContainedParamsVersion>
<ParamContainerItems Version="1">
<ParamContainerItem Index="0" ObjectRef="11"/>
<ParamContainerItem Index="1" ObjectRef="12"/>
<ParamContainerItem Index="2" ObjectRef="13"/>
</ParamContainerItems>
</ExporterParamContainer>
<ExporterParam ObjectID="11" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioRatePerSecond</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>true</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>0</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>48000</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="12" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioNumChannels</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>true</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>1</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>2</ParamValue>
</ExporterParam>
<ExporterParam ObjectID="13" ClassID="9f049ab7-d48f-43e9-a8ca-4d7f21233625" Version="1">
<ParamAuxType></ParamAuxType>
<ParamAuxValue></ParamAuxValue>
<ParamIdentifier>ADBEAudioSampleType</ParamIdentifier>
<ParamConstrainedListIsOptional>false</ParamConstrainedListIsOptional>
<IsFilePathString>false</IsFilePathString>
<IsOptionalParamEnabled>false</IsOptionalParamEnabled>
<IsOptionalParam>false</IsOptionalParam>
<IsParamPairGroup>false</IsParamPairGroup>
<ParamIsPassword>false</ParamIsPassword>
<ParamIsMultiLine>false</ParamIsMultiLine>
<ParamIsVerticallyAligned>false</ParamIsVerticallyAligned>
<ParamIsHidden>false</ParamIsHidden>
<ParamIsDisabled>false</ParamIsDisabled>
<ParamIsIndependant>true</ParamIsIndependant>
<ParamIsSlider>false</ParamIsSlider>
<ParamDontSerializeValue>false</ParamDontSerializeValue>
<ParamOrdinalValue>2</ParamOrdinalValue>
<ParamType>2</ParamType>
<ParamValue>1</ParamValue>
</ExporterParam>
</PremiereData>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View file

@ -1,21 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Avalon</title>
<link rel="stylesheet" type="text/css" href="css/app.css">
</head>
<body onLoad="onLoaded()">
</body>
<script src="./lib/app.js"></script>
<script src="./lib/json2.js"></script>
<script src="./lib/CSInterface.js"></script>
<script src="./lib/CEPEngine_extensions.js"></script>
<script src="./lib/jquery-1.9.1.js"></script>
<script src="./lib/Vulcan.js"></script>
</html>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,91 +0,0 @@
/// <reference path="JavaScript.d.ts" />
interface ExternalObjectConstructor {
readonly prototype: ExternalObject
/**
* Creates a new ExternalObject object.
*/
new (lib: string): ExternalObject
(lib: string): ExternalObject
}
declare const ExternalObject: ExternalObjectConstructor
interface ExternalObject {
/**
* Set to true to write status information to standard output (the
* JavaScript Console in the ExtendScript Toolkit). Set to false to turn
* logging off. Default is false.
*/
log: boolean
/**
* A set of alternate paths in which to search for the shared library files, a
* single string with multiple path specifications delimited by semicolons
* (;). Paths can be absolute or relative to the Folder.startup location.
*/
searchFolders: string
/**
* The version of the library, as returned by ESGetVersion()
*/
version: number
/**
* Reports whether a compiled C/C++ library can be found, but does not load it. If logging is on, the
* paths searched are reported to the JavaScript Console in the ExtendScript Toolkit.
* Returns true if the library is found, false otherwise.
* @param spec The file specification for the compiled library, with or without path information.
*/
search(spec: string): boolean
/**
* Explicitly shuts down the ExternalObject dynamic library wrapped by this instance.
* It can be helpful to force a shutdown of the external library if termination of external libraries during
* the shutdown of the hosting application does not occur in the correct order.
*/
terminate(): undefined
}
interface CSXSEventConstructor {
readonly prototype: CSXSEvent
/**
* Creates a new CSXSEvent object.
*/
new (type?: string, scope?: string, data?: string): CSXSEvent
(type?: string, scope?: string, data?: string): CSXSEvent
}
declare const CSXSEvent: CSXSEventConstructor
interface CSXSEvent {
/**
* Retrieves the unique identifier of the application from which this event was dispatched.
*/
readonly appId: string
/**
* Retrieves or sets the payload of this event.
*/
data: string
/**
* Retrieves the unique identifier of the extension from which this event was dispatched.
*/
readonly extensionId: string
/**
* Retrieves the scope of this event.
*/
scope: string
/**
* Retrieves the type of this event.
*/
type: string
/**
* Dispatch the event
*/
dispatch(): void
}

File diff suppressed because it is too large Load diff

View file

@ -1,363 +0,0 @@
/* global app, XMPMeta, ExternalObject, CSXSEvent, Folder */
/* --------------------------------------
-. == [ part 0f PyPE CluB ] == .-
_______________.___._____________________
\______ \__ | |\______ \_ _____/
| ___// | | | ___/| __)_
| | \____ | | | | \
|____| / ______| |____| /_______ /
\/ \/
.. __/ CliP R3N4M3R \__ ..
*/
var renamer = {};
/**
* Sequence-rename selected clips and establish their hierarchy based upon provided
* data. Using data.folder, data.episode, data.sequence to name a clip and write
* resulting hierarchical clip data into sequence metadata via XMP.
*
* @param {Object} data - data {'folder', 'episode', 'sequence', 'pattern', 'increment', 'start'}
* @return {String} state
*/
renamer.renameSeqHierarchy = function (data) { // eslint-disable-line no-unused-vars
var sequence = app.project.activeSequence;
var selected = sequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
app.setSDKEventMessage('pattern ' + data.pattern + '\n' + 'increment ' + data.increment, 'info');
// get padding
var padPtr = RegExp('(?:.*?)(#+)(.*)');
var res = data.pattern.match(padPtr);
// res is now null if there is no padding string (###) in Pattern
// res[1] is padding string
if (!res) {
app.setSDKEventMessage('no padding string detected in pattern ' + data.pattern, 'error');
return false;
}
// convert to int
var index = parseInt(data.start);
// change padding string to zero: '####' -> '0000'
var rx = RegExp('#', 'g');
var fgexp = RegExp('{folder}', 'i');
var egexp = RegExp('{episode}', 'i');
var sgexp = RegExp('{sequence}', 'i');
var shotrg = RegExp('{shot}', 'i');
var zero = res[1].replace(rx, '0');
// iterate over selection
var metadata = renamer.getSequencePypeMetadata(sequence);
for (var c = 0; c < selected.length; c++) {
var mediaType = selected[c].mediaType;
if (mediaType === 'Audio') {
continue
}
delete metadata.clips[selected[c].name];
// convert index to string
var indexStr = '' + index;
// left-zero pad number
var padding = zero.substring(0, zero.length - indexStr.length) + indexStr;
// put name together
// replace {shot} token
selected[c].name = data.pattern.replace(shotrg, selected[c].name);
selected[c].name = selected[c].name.replace(res[1], padding);
selected[c].name = selected[c].name.replace(fgexp, data.folder);
selected[c].name = selected[c].name.replace(egexp, data.episode);
selected[c].name = selected[c].name.replace(sgexp, data.sequence);
// fill in hierarchy if set
var parents = [];
var hierarchy = [];
if (data.folder) {
parents.push({
'entityType': 'folder',
'entityName': data.folder
});
hierarchy.push(data.folder);
}
if (data.episode) {
parents.push({
'entityType': 'episode',
'entityName': data.episode
});
hierarchy.push(data.episode);
}
if (data.sequence) {
parents.push({
'entityType': 'sequence',
'entityName': data.sequence
});
hierarchy.push(data.sequence);
}
// push it to metadata
metadata.clips[selected[c].name] = {
'parents': parents,
'hierarchy': hierarchy.join('/')
};
// add increment
index = index + parseInt(data.increment);
}
renamer.setSequencePypeMetadata(sequence, metadata);
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Sequence rename seleced clips
* @param {Object} data - {pattern, start, increment}
*/
renamer.renameSeq = function (data) { // eslint-disable-line no-unused-vars
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
app.setSDKEventMessage('pattern ' + data.pattern + '\n' + 'increment ' + data.increment, 'info');
// get padding
var padPtr = RegExp('(?:.*?)(#+)(?:.*)');
var res = data.pattern.match(padPtr);
// res is now null if there is no padding string (###) in Pattern
// res[1] is padding string
if (!res) {
app.setSDKEventMessage('no padding string detected in pattern ' + data.pattern, 'error');
return false;
}
// convert to int
var index = parseInt(data.start);
// change padding string to zero: '####' -> '0000'
var rx = RegExp('#', 'g');
var zero = res[2].replace(rx, '0');
// iterate over selection
for (var c = 0; c < selected.length; c++) {
// convert index to string
var indexStr = '' + index;
// left-zero pad number
var padding = zero.substring(0, zero.length - indexStr.length) + indexStr;
// put name together
selected[c].name = data.pattern.replace(res[1], padding);
// add increment
index = index + parseInt(data.increment);
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Simple rename clips
* @param {string} newName - new clip name. `{shot}` designates current clip name
* @return {string} result - return stringified JSON status
*/
renamer.renameSimple = function (newName) { // eslint-disable-line no-unused-vars
app.setSDKEventMessage('Replacing with pattern ' + newName, 'info');
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
var rx = RegExp('{shot}', 'i');
for (var c = 0; c < selected.length; c++) {
// find {shot} token and replace it with existing clip name
selected[c].name = newName.replace(rx, selected[c].name);
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Find string in clip name and replace it with another
* @param {Object} data - {find, replaceWith} object
* @return {string} result - return stringified JSON status
*/
renamer.renameFindReplace = function (data) { // eslint-disable-line no-unused-vars
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
var rx = RegExp('{shot}', 'i');
for (var c = 0; c < selected.length; c++) {
// replace {shot} token with actual clip name
var find = data.find.replace(rx, selected[c].name);
var repl = data.replaceWith.replace(rx, selected[c].name);
// replace find with replaceWith
selected[c].name = selected[c].name.replace(find, repl);
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Replace current clip name with filename (without extension)
* @return {string} result - return stringified JSON status
*/
renamer.renameClipRename = function () { // eslint-disable-line no-unused-vars
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
var regexp = new RegExp('.[^/.]+$');
for (var c = 0; c < selected.length; c++) {
// suddenly causes syntax error on regexp? So using explicit contructor
// regexp above.
// selected[c].name = selected[c].projectItem.name.replace(/\.[^/.]+$/, '');
selected[c].name = selected[c].projectItem.name.replace(regexp, '');
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Change clip name to lower or upper case
* @param {int} case - 0 lower, 1 upper
* @return {string} result - return stringified JSON status
*/
renamer.renameChangeCase = function (caseMode) { // eslint-disable-line no-unused-vars
var selected = app.project.activeSequence.getSelection();
if (selected.length < 1) {
app.setSDKEventMessage('nothing selected', 'error');
return false;
}
for (var c = 0; c < selected.length; c++) {
if (caseMode === 0) {
selected[c].name = selected[c].name.toLowerCase();
} else {
selected[c].name = selected[c].name.toUpperCase();
}
}
return JSON.stringify({
'status': 'renamed ' + selected.length + ' clips'
});
};
/**
* Set Pype metadata into sequence metadata using XMP.
* This is `hackish` way to get over premiere lack of addressing unique clip on timeline,
* so we cannot store data directly per clip.
*
* @param {Object} sequence - sequence object
* @param {Object} data - to be serialized and saved
*/
renamer.setSequencePypeMetadata = function (sequence, data) { // eslint-disable-line no-unused-vars
var kPProPrivateProjectMetadataURI = 'http://ns.adobe.com/premierePrivateProjectMetaData/1.0/';
var metadata = sequence.projectItem.getProjectMetadata();
var pypeData = 'pypeData';
var xmp = new XMPMeta(metadata);
var dataJSON = JSON.stringify(data);
app.project.addPropertyToProjectMetadataSchema(pypeData, 'Pype Data', 2);
xmp.setProperty(kPProPrivateProjectMetadataURI, pypeData, dataJSON);
var str = xmp.serialize();
sequence.projectItem.setProjectMetadata(str, [pypeData]);
// test
var newMetadata = sequence.projectItem.getProjectMetadata();
var newXMP = new XMPMeta(newMetadata);
var found = newXMP.doesPropertyExist(kPProPrivateProjectMetadataURI, pypeData);
if (!found) {
app.setSDKEventMessage('metadata not set', 'error');
}
};
/**
* Get Pype metadata from sequence using XMP.
* @param {Object} sequence
* @return {Object}
*/
renamer.getSequencePypeMetadata = function (sequence) { // eslint-disable-line no-unused-vars
var kPProPrivateProjectMetadataURI = 'http://ns.adobe.com/premierePrivateProjectMetaData/1.0/';
var metadata = sequence.projectItem.getProjectMetadata();
var pypeData = 'pypeData';
var pypeDataN = 'Pype Data';
var xmp = new XMPMeta(metadata);
app.project.addPropertyToProjectMetadataSchema(pypeData, pypeDataN, 2);
var pypeDataValue = xmp.getProperty(kPProPrivateProjectMetadataURI, pypeData);
if (pypeDataValue === undefined) {
var metadata = {
clips: {},
tags: {}
};
renamer.setSequencePypeMetadata(sequence, metadata);
pypeDataValue = xmp.getProperty(kPProPrivateProjectMetadataURI, pypeData);
return renamer.getSequencePypeMetadata(sequence);
} else {
return JSON.parse(pypeDataValue);
}
};
function keepExtension() {
return app.setExtensionPersistent('com.pype.rename', 0);
}
/**
* Dispatch event with new selection
*/
renamer.activeSequenceSelectionChanged = function () {
var sel = app.project.activeSequence.getSelection();
var selection = [];
for (var i = 0; i < sel.length; i++) {
if (sel[i].name !== 'anonymous') {
selection.push({
'name': sel[i].name,
'path': sel[i].projectItem.getMediaPath()
});
}
}
var eoName;
if (Folder.fs === 'Macintosh') {
eoName = 'PlugPlugExternalObject';
} else {
eoName = 'PlugPlugExternalObject.dll';
}
var mylib = new ExternalObject('lib:' + eoName);
var eventObj = new CSXSEvent();
eventObj.type = 'activeSequenceSelectionChanged';
eventObj.data = JSON.stringify(selection);
eventObj.dispatch();
// app.setSDKEventMessage('selection changed', 'info');
};
/**
* Register active selection event dispatching
*/
renamer.registerActiveSelectionChanged = function () {
var success = app.bind('onActiveSequenceSelectionChanged', renamer.activeSequenceSelectionChanged);
return success;
};
keepExtension();
// load the XMPScript library
if (ExternalObject.AdobeXMPScript === undefined) {
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
}
// var seq = app.project.activeSequence;
// renamer.getSequencePypeMetadata(seq);
var messageText = 'this module is loaded> PypeRename.jsx';
$._PPP_.updateEventPanel(messageText);
$.writeln(messageText);

View file

@ -1,51 +0,0 @@
// A commonly used construct for loading XMPScript into
// ExtendScript contexts.
interface ExternalObjectConstructor {
AdobeXMPScript: ExternalObject | undefined;
}
interface XMPMetaConstructor {
/** Creates an empty object. */
new (): XMPMetaInstance;
/**
* @param packet A String containing an XML file or an XMP packet.
*/
new (packet: string): XMPMetaInstance;
/**
* @param buffer The UTF-8 or UTF-16 encoded bytes of an XML file
* or an XMP packet. This array is the result of a call to `serializeToArray`
* on an `XMPMeta` instance.
*/
new (buffer: number[]): XMPMetaInstance;
// Class stuff.
}
interface XMPMetaInstance {
doesPropertyExist(namespace:String, value:String): Boolean
getProperty(namespace:String, property:String): XMPProperty
setProperty(namespace:String, property:String, value:String): Boolean
countArrayItems(namespace:String, property:String): Number
getArrayItem(namespace:String, property:String, itemIndex:Number): XMPProperty
deleteProperty(namespace:String, property:String): Boolean
appendArrayItem(namespace:String, property:String, arrayOptions:String, valueToAppend:String, valueOptions:String): Boolean
dumpObject():String
serialize(): String
// Instance stuff.
}
declare const XMPMeta: XMPMetaConstructor | undefined;
interface XMPConstConstructor {
new (): XMPConstInstance;
NS_DM: string;
NS_DC: string;
ARRAY_IS_ORDERED: string;
// Class stuff.
}
interface XMPConstInstance {
// Instance stuff.
}
declare const XMPConst: XMPConstConstructor | undefined;

View file

@ -1,105 +0,0 @@
/* global $, JSON, app, XMPMeta, ExternalObject, CSXSEvent, Folder */
/* --------------------------------------
-. == [ part 0f PyPE CluB ] == .-
_______________.___._____________________
\______ \__ | |\______ \_ _____/
| ___// | | | ___/| __)_
| | \____ | | | | \
|____| / ______| |____| /_______ /
\/ \/
.. __/ CliP R3N4M3R \__ ..
*/
var BatchRenamer = {
getSelectedVideoTrackItems: function() {
var seq = app.project.activeSequence;
var selected = [];
var videoTracks = seq.videoTracks;
var numOfVideoTracks = videoTracks.numTracks;
// VIDEO CLIPS IN SEQUENCES
for (var l = 0; l < numOfVideoTracks; l++) {
var videoTrack = seq.videoTracks[l];
if (videoTrack.isTargeted()) {
$.writeln(videoTrack.name);
// var numOfClips = videoTrack.clips.numTracks;
var numOfClips = videoTrack.clips.numItems;
for (var m = 0; m < numOfClips; m++) {
var clip = videoTrack.clips[m];
selected.push({
name: clip.name,
clip: clip,
sequence: seq,
videoTrack: videoTrack
});
}
}
}
var names = [];
var items = {};
var sorted = [];
for (var c = 0; c < selected.length; c++) {
items[selected[c].name] = selected[c];
names.push(selected[c].name);
}
names.sort();
for (var cl = 0; cl < names.length; cl++) {
sorted.push(items[names[cl]]);
}
return sorted;
},
renameTargetedTextLayer: function (data) {
$.bp(true);
$.writeln(data);
var selected = BatchRenamer.getSelectedVideoTrackItems();
var seq = app.project.activeSequence;
var metadata = $.pype.getSequencePypeMetadata(seq, true);
var padding = 3;
var newItems = {};
var projectCode = data.projectCode
var episode = data.ep;
var episodeSuf = data.epSuffix;
var shotPref = 'sh';
for (var c = 0; c < selected.length; c++) {
// fill in hierarchy if set
var parents = [];
var hierarchy = [];
var name = selected[c].name;
var sequenceName = name.slice(0, 5);
var shotNum = Number(name.slice((name.length - 3), name.length));
var newName = projectCode + episode + sequenceName + shotPref + (shotNum).pad(padding);
$.pype.log(newName);
selected[c].clip.name = newName;
parents.push({
'entityType': 'Episode',
'entityName': episode + '_' + episodeSuf
});
hierarchy.push(episode + '_' + episodeSuf);
parents.push({
'entityType': 'Sequence',
'entityName': episode + sequenceName
});
hierarchy.push(episode + sequenceName);
newItems[newName] = {
'parents': parents,
'hierarchy': hierarchy.join('/')
};
}
metadata.clips = newItems;
$.pype.setSequencePypeMetadata(seq, metadata);
return JSON.stringify(metadata);
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,149 +0,0 @@
/**
* The global BridgeTalk object.
*/
declare var BridgeTalk: any
/**
* The Infinity global property is a predefined variable with the value for infinity.
*/
declare var Infinity: number
/**
* The NaN global property is a predefined variable with the value NaN (Not-a-Number), as specified by the IEEE-754 standard.
*/
declare var NaN: number
/**
* The application object
*/
declare var app: Application
declare interface Application {}
/**
* Displays an alert box
* @param message The text to display
* @param title The title of the alert; ignored on the Macintosh
* @param errorIcon Display an Error icon; ignored on the Macintosh
*/
declare function alert(message: string, title?: string, errorIcon?: boolean): void
/**
* Displays an alert box with Yes and No buttons; returns true for Yes
* @param message The text to display
* @param noAsDefault Set to true to set the No button as the default button
* @param title The title of the alert; ignored on the Macintosh
*/
declare function confirm(message: string, noAsDefault?: boolean, title?: string): boolean
/**
* Decodes a string created with encodeURI().
* @param uri The text to decode.
*/
declare function decodeURI(uri: string): string
/**
* Decodes a string created with encodeURIComponent().
* @param uri The text to decode.
*/
declare function decodeURIComponent(uri: string): string
/**
* Encodes a string after RFC2396.
* Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape
* character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'();/?:@&=+$,#. The method returns false on errors.
* @param text The text to encode.
*/
declare function encodeURI(text: string): string
/**
* Encodes a string after RFC2396.
* Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape
* character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'(). The method returns false on errors.
* @param text The text to encode.
*/
declare function encodeURIComponent(text: string): string
/**
* Creates a URL-encoded string from aString.
* In the new string, characters of aString that require URL encoding are replaced with the format %xx, where xx is the hexadecimal value of the character code in the Unicode character set.This format is used to transmit information appended to a URL during, for example, execution of the GET method.Use the unescape() global function to translate the string back into its original format. Returns a string which is aString URL-encoded.
* @param aString The string to be encoded.
*/
declare function escape(aString: string): string
/**
* Evaluates its argument as a JavaScript script, and returns the result of evaluation.
* You can pass the result of an object's toSource() method to reconstruct that object.
* @param stringExpression The string to evaluate.
*/
declare function eval(stringExpression: string): any
/**
* Evaluates an expression and reports whether the result is a finite number.
* Returns true if the expression is a finite number, false otherwise. False if the value is infinity or negative infinity.
* @param expression Any valid JavaScript expression.
*/
declare function isFinite(expression: number): boolean
/**
* Evaluates an expression and reports whether the result is "Not-a-Number" (NaN).
* Returns true if the result of evaluation is not a number (NaN), false if the value is a number.
* @param expression Any valid JavaScript expression.
*/
declare function isNaN(expression: number): boolean
/**
* Returns true if the supplied string is a valid XML name.
* @param name The XML name to test.
*/
declare function isXMLName(name: string): boolean
/**
* Localizes a ZString-encoded string and merges additional arguments into the string.
* @param what The string to localize. A ZString-encoded string that can contain placeholder for additional arguments in the form %1 to %n.
* @param arguments Optional argument(s) to be merged into the string. There may be more than one argument.
*/
declare function localize(what: string, ...arguments: any[]): string
/**
* Extracts a floating-point number from a string.
* Parses a string to find the first set of characters that can be converted to a floating point number, and returns that number, or NaN if it does not encounter characters that it can converted to a number.The function supports exponential notation.
* @param text The string from which to extract a floating point number.
*/
declare function parseFloat(text: string): number
/**
* Extracts an integer from a string.
* Parses a string to find the first set of characters, in a specified base, that can be converted to an integer, and returns that integer, or NaN if it does not encounter characters that it can convert to a number.
* @param text The string from which to extract an integer.
* @param base The base of the string to parse (from base 2 to base 36). If not supplied, base is determined by the format of string.
*/
declare function parseInt(text: string, base?: number): number
/**
* Displays a dialog allowing the user to enter text
* Returns null if the user cancelled the dialog, the text otherwise
* @param prompt The text to display
* @param default_ The default text to preset the edit field with
* @param title The title of the dialog;
*/
declare function prompt(prompt: string, default_?: string, title?: string): string
/**
* Defines the default XML namespace.
* This is a replacement function for the standard JavaScript statement set default xml namespace.
* @param namespace The namespace to use. Omit this parameter to return to the empty namespace. This is either a Namespace object or a string.
*/
declare function setDefaultXMLNamespace(namespace: Namespace): void
/**
* Translates URL-encoded string into a regular string, and returns that string.
* Use the escape() global function to URL-encode strings.
* @param stringExpression The URL-encoded string to convert.
*/
declare function unescape(stringExpression: string): string
/**
* Creates a source code representation of the supplied argument, and returns it as a string.
* @param what The object to uneval.
*/
declare function uneval(what: any): string

View file

@ -1,7 +0,0 @@
{
"compilerOptions": {
"noLib": true,
"checkJs": true
},
"include": ["**/*"]
}

File diff suppressed because it is too large Load diff

View file

@ -1,11 +0,0 @@
var extensionFolder = new Folder(
'C:/Users/jezsc/CODE/pype-setup/repos/pype/pype/premiere/extensions/com.pype');
$.writeln(extensionFolder);
var mainJsx = extensionFolder + '/pypeApp.jsx';
$.evalFile(mainJsx);
var appName = 'PPRO';
$._ext.evalJSXFiles(extensionFolder, appName);
$._ext.evalJSFiles(extensionFolder);
///////////////////////////////////////////////////////////////////////////////////////////////////////////
$.pype.getSequencePypeMetadata(app.project.activeSequence);

View file

@ -1,699 +0,0 @@
/**************************************************************************************************
*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2013 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*
**************************************************************************************************/
// This is the JavaScript code for bridging to native functionality
// See CEPEngine_extensions.cpp for implementation of native methods.
//
// Note: So far all native file i/o functions are synchronous, and aynchronous file i/o is TBD.
/** Version v8.0.0 */
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
/*global define, native */
var cep;
if (!cep) {
cep = {};
}
if (!cep.fs) {
cep.fs = {};
}
if (!cep.process) {
cep.process = {};
}
if (!cep.encoding) {
cep.encoding = {};
}
if (!cep.util) {
cep.util = {};
}
(function () {
// Internal function to get the last error code.
native function GetLastError();
function getLastError() {
return GetLastError();
}
function getErrorResult(){
var result = {err: getLastError()};
return result;
}
// Error values. These MUST be in sync with the error values
// at the top of CEPEngine_extensions.cpp
/**
* @constant No error.
*/
cep.fs.NO_ERROR = 0;
/**
* @constant Unknown error occurred.
*/
cep.fs.ERR_UNKNOWN = 1;
/**
* @constant Invalid parameters passed to function.
*/
cep.fs.ERR_INVALID_PARAMS = 2;
/**
* @constant File or directory was not found.
*/
cep.fs.ERR_NOT_FOUND = 3;
/**
* @constant File or directory could not be read.
*/
cep.fs.ERR_CANT_READ = 4;
/**
* @constant An unsupported encoding value was specified.
*/
cep.fs.ERR_UNSUPPORTED_ENCODING = 5;
/**
* @constant File could not be written.
*/
cep.fs.ERR_CANT_WRITE = 6;
/**
* @constant Target directory is out of space. File could not be written.
*/
cep.fs.ERR_OUT_OF_SPACE = 7;
/**
* @constant Specified path does not point to a file.
*/
cep.fs.ERR_NOT_FILE = 8;
/**
* @constant Specified path does not point to a directory.
*/
cep.fs.ERR_NOT_DIRECTORY = 9;
/**
* @constant Specified file already exists.
*/
cep.fs.ERR_FILE_EXISTS = 10;
/**
* @constant The maximum number of processes has been exceeded.
*/
cep.process.ERR_EXCEED_MAX_NUM_PROCESS = 101;
/**
* @constant Invalid URL.
*/
cep.util.ERR_INVALID_URL = 201;
/**
* @constant deprecated API.
*/
cep.util.DEPRECATED_API = 202;
/**
* @constant UTF8 encoding type.
*/
cep.encoding.UTF8 = "UTF-8";
/**
* @constant Base64 encoding type.
*/
cep.encoding.Base64 = "Base64";
/**
* Displays the OS File Open dialog, allowing the user to select files or directories.
*
* @param allowMultipleSelection {boolean} When true, multiple files/folders can be selected.
* @param chooseDirectory {boolean} When true, only folders can be selected. When false, only
* files can be selected.
* @param title {string} Title of the open dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected. Ignored when chooseDirectory=true.
*
* @return An object with these properties:
* <ul><li>"data": An array of the full names of the selected files.</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowOpenDialog();
cep.fs.showOpenDialog = function (allowMultipleSelection, chooseDirectory, title, initialPath, fileTypes) {
var resultString = ShowOpenDialog(allowMultipleSelection, chooseDirectory,
title || 'Open', initialPath || '',
fileTypes ? fileTypes.join(' ') : '');
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Displays the OS File Open dialog, allowing the user to select files or directories.
*
* @param allowMultipleSelection {boolean} When true, multiple files/folders can be selected.
* @param chooseDirectory {boolean} When true, only folders can be selected. When false, only
* files can be selected.
* @param title {string} Title of the open dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected. Ignored when chooseDirectory=true.
* @param friendlyFilePrefix {string} String to put in front of the extensions
* of files that can be selected. Ignored when chooseDirectory=true. (win only)
* For example:
* fileTypes = ["gif", "jpg", "jpeg", "png", "bmp", "webp", "svg"];
* friendlyFilePrefix = "Images (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.webp;*.svg)";
* @param prompt {string} String for OK button (mac only, default is "Open" on mac, "Open" or "Select Folder" on win).
*
* @return An object with these properties:
* <ul><li>"data": An array of the full names of the selected files.</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowOpenDialogEx();
cep.fs.showOpenDialogEx = function (allowMultipleSelection, chooseDirectory, title, initialPath, fileTypes,
friendlyFilePrefix, prompt) {
var resultString = ShowOpenDialogEx(allowMultipleSelection, chooseDirectory,
title || 'Open', initialPath || '',
fileTypes ? fileTypes.join(' ') : '', friendlyFilePrefix || '',
prompt || '');
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Displays the OS File Save dialog, allowing the user to type in a file name.
*
* @param title {string} Title of the save dialog.
* @param initialPath {string} Initial path to display in the dialog. Pass NULL or "" to
* display the last path chosen.
* @param fileTypes {Array.<string>} The file extensions (without the dot) for the types
* of files that can be selected.
* @param defaultName {string} String to start with for the file name.
* @param friendlyFilePrefix {string} String to put in front of the extensions of files that can be selected. (win only)
* For example:
* fileTypes = ["gif", "jpg", "jpeg", "png", "bmp", "webp", "svg"];
* friendlyFilePrefix = "Images (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.webp;*.svg)";
* @param prompt {string} String for Save button (mac only, default is "Save" on mac and win).
* @param nameFieldLabel {string} String displayed in front of the file name text field (mac only, "File name:" on win).
*
* @return An object with these properties:
* <ul><li>"data": The file path selected to save at or "" if canceled</li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function ShowSaveDialogEx();
cep.fs.showSaveDialogEx = function (title, initialPath, fileTypes, defaultName, friendlyFilePrefix, prompt, nameFieldLabel) {
var resultString = ShowSaveDialogEx(title || '', initialPath || '',
fileTypes ? fileTypes.join(' ') : '', defaultName || '',
friendlyFilePrefix || '', prompt || '', nameFieldLabel || '');
var result = {data: resultString || '', err: getLastError() };
return result;
};
/**
* Reads the contents of a folder.
*
* @param path {string} The path of the folder to read.
*
* @return An object with these properties:
* <ul><li>"data": An array of the names of the contained files (excluding '.' and '..'.</li>
* <li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_CANT_READ </li></ul>
**/
native function ReadDir();
cep.fs.readdir = function (path) {
var resultString = ReadDir(path);
var result = {data: JSON.parse(resultString || '[]'), err: getLastError() };
return result;
};
/**
* Creates a new folder.
*
* @param path {string} The path of the folder to create.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function MakeDir();
cep.fs.makedir = function (path) {
MakeDir(path);
return getErrorResult();
};
/**
* Renames a file or folder.
*
* @param oldPath {string} The old name of the file or folder.
* @param newPath {string} The new name of the file or folder.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_FILE_EXISTS </li></ul>
**/
native function Rename();
cep.fs.rename = function(oldPath, newPath) {
Rename(oldPath, newPath);
return getErrorResult();
};
/**
* Reports whether an item is a file or folder.
*
* @param path {string} The path of the file or folder.
*
* @return An object with these properties:
* <ul><li>"data": An object with properties
* <br>isFile (boolean)
* <br>isDirectory (boolean)
* <br>mtime (modification DateTime) </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND </li>
* </ul>
**/
native function IsDirectory();
native function GetFileModificationTime();
cep.fs.stat = function (path) {
var isDir = IsDirectory(path);
var modtime = GetFileModificationTime(path);
var result = {
data: {
isFile: function () {
return !isDir;
},
isDirectory: function () {
return isDir;
},
mtime: modtime
},
err: getLastError()
};
return result;
};
/**
* Reads the entire contents of a file.
*
* @param path {string} The path of the file to read.
* @param encoding {string} The encoding of the contents of file, one of
* UTF8 (the default) or Base64.
*
* @return An object with these properties:
* <ul><li>"data": The file contents. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_CANT_READ
* <br>ERR_UNSUPPORTED_ENCODING </li>
* </ul>
**/
native function ReadFile();
cep.fs.readFile = function (path, encoding) {
encoding = encoding ? encoding : cep.encoding.UTF8;
var contents = ReadFile(path, encoding);
var result = {data: contents, err: getLastError() };
return result;
};
/**
* Writes data to a file, replacing the file if it already exists.
*
* @param path {string} The path of the file to write.
* @param data {string} The data to write to the file.
* @param encoding {string} The encoding of the contents of file, one of
* UTF8 (the default) or Base64.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_UNSUPPORTED_ENCODING
* <br>ERR_CANT_WRITE
* <br>ERR_OUT_OF_SPACE </li></ul>
**/
native function WriteFile();
cep.fs.writeFile = function (path, data, encoding) {
encoding = encoding ? encoding : cep.encoding.UTF8;
WriteFile(path, data, encoding);
return getErrorResult();
};
/**
* Sets permissions for a file or folder.
*
* @param path {string} The path of the file or folder.
* @param mode {number} The permissions in numeric format (for example, 0777).
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_CANT_WRITE </li></ul>
**/
native function SetPosixPermissions();
cep.fs.chmod = function (path, mode) {
SetPosixPermissions(path, mode);
return getErrorResult();
};
/**
* Deletes a file.
*
* @param path {string} The path of the file to delete.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_NOT_FOUND
* <br>ERR_NOT_FILE </li></ul>
**/
native function DeleteFileOrDirectory();
native function IsDirectory();
cep.fs.deleteFile = function (path) {
if (IsDirectory(path)) {
var result = {err: cep.fs.ERR_NOT_FILE};
return result;
}
DeleteFileOrDirectory(path);
return getErrorResult();
};
/**
* Creates a process.
*
* @param arguments {list} The arguments to create process. The first one is the full path of the executable,
* followed by the arguments of the executable.
*
* @return An object with these properties:
* <ul><li>"data": The pid of the process, or -1 on error. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_EXCEED_MAX_NUM_PROCESS
* <br>ERR_NOT_FOUND
* <br>ERR_NOT_FILE</li>
* </ul>
**/
native function CreateProcess();
cep.process.createProcess = function () {
var args = Array.prototype.slice.call(arguments);
var pid = CreateProcess(args);
var result = {data: pid, err: getLastError()};
return result;
};
/**
* Registers a standard-output handler for a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function for the standard output callback.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function SetupStdOutHandler();
cep.process.stdout = function (pid, callback) {
SetupStdOutHandler(pid, callback);
return getErrorResult();
};
/**
* Registers up a standard-error handler for a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function for the standard error callback.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function SetupStdErrHandler();
cep.process.stderr = function (pid, callback) {
SetupStdErrHandler(pid, callback);
return getErrorResult();
};
/**
* Writes data to the standard input of a process.
*
* @param pid {int} The pid of the process
* @param data {string} The data to write.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function WriteStdIn();
cep.process.stdin = function (pid, data) {
WriteStdIn(pid, data);
return getErrorResult();
};
/**
* Retrieves the working directory of a process.
*
* @param pid {int} The pid of the process.
*
* @return An object with these properties:
* <ul><li>"data": The path of the working directory. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function GetWorkingDirectory();
cep.process.getWorkingDirectory = function (pid) {
var wd = GetWorkingDirectory(pid);
var result = {data: wd, err: getLastError()};
return result;
};
/**
* Waits for a process to quit.
*
* @param pid {int} The pid of the process.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function WaitFor();
cep.process.waitfor = function (pid) {
WaitFor(pid);
return getErrorResult();
};
/**
* Registers a handler for the onquit callback of a process.
*
* @param pid {int} The pid of the process.
* @param callback {function} The handler function.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function OnQuit();
cep.process.onquit = function (pid, callback) {
OnQuit(pid, callback);
return getErrorResult();
};
/**
* Reports whether a process is currently running.
*
* @param pid {int} The pid of the process.
*
* @return An object with these properties:
* <ul><li>"data": True if the process is running, false otherwise. </li>
* <li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function IsRunning();
cep.process.isRunning = function (pid) {
var isRunning = IsRunning(pid);
var result = {data: isRunning, err: getLastError()};
return result;
};
/**
* Terminates a process.
*
* @param pid {int} The pid of the process
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS
* <br>ERR_INVALID_PROCESS_ID </li></ul>
**/
native function Terminate();
cep.process.terminate = function (pid) {
Terminate(pid);
return getErrorResult();
};
/**
* Encoding conversions.
*
*/
cep.encoding.convertion =
{
utf8_to_b64: function(str) {
return window.btoa(unescape(encodeURIComponent(str)));
},
b64_to_utf8: function(base64str) {
// If a base64 string contains any whitespace character, DOM Exception 5 occurs during window.atob, please see
// http://stackoverflow.com/questions/14695988/dom-exception-5-invalid-character-error-on-valid-base64-image-string-in-javascri
base64str = base64str.replace(/\s/g, '');
return decodeURIComponent(escape(window.atob(base64str)));
},
binary_to_b64: function(binary) {
return window.btoa(binary);
},
b64_to_binary: function(base64str) {
return window.atob(base64str);
},
ascii_to_b64: function(ascii) {
return window.btoa(binary);
},
b64_to_ascii: function(base64str) {
return window.atob(base64str);
}
};
/**
* Opens a page in the default system browser.
*
* @param url {string} The URL of the page/file to open, or the email address.
* Must use HTTP/HTTPS/file/mailto. For example:
* "http://www.adobe.com"
* "https://github.com"
* "file:///C:/log.txt"
* "mailto:test@adobe.com"
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_UNKNOWN
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function OpenURLInDefaultBrowser();
cep.util.openURLInDefaultBrowser = function (url) {
if (url && (url.indexOf("http://") === 0 ||
url.indexOf("https://") === 0 ||
url.indexOf("file://") === 0 ||
url.indexOf("mailto:") === 0)) {
OpenURLInDefaultBrowser(url);
return getErrorResult();
} else {
return { err : cep.util.ERR_INVALID_URL };
}
};
/**
* Registers a callback function for extension unload. If called more than once,
* the last callback that is successfully registered is used.
*
* @deprecated since version 6.0.0
*
* @param callback {function} The handler function.
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of:
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS</li></ul>
**/
native function RegisterExtensionUnloadCallback();
cep.util.registerExtensionUnloadCallback = function (callback) {
return { err : cep.util.DEPRECATED_API };
};
/**
* Stores the user's proxy credentials
*
* @param username {string} proxy username
* @param password {string} proxy password
*
* @return An object with this property:
* <ul><li>"err": The status of the operation, one of
* <br>NO_ERROR
* <br>ERR_INVALID_PARAMS </li>
* </ul>
**/
native function StoreProxyCredentials();
cep.util.storeProxyCredentials = function (username, password) {
StoreProxyCredentials(username, password);
return getErrorResult();
};
})();

File diff suppressed because it is too large Load diff

View file

@ -1,459 +0,0 @@
/**************************************************************************************************
*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2013 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*
**************************************************************************************************/
/** Vulcan - v9.2.0 */
/**
* @class Vulcan
*
* The singleton instance, <tt>VulcanInterface</tt>, provides an interface
* to the Vulcan. Allows you to launch CC applications
* and discover information about them.
*/
function Vulcan()
{
}
/**
* Gets all available application specifiers on the local machine.
*
* @return The array of all available application specifiers.
*/
Vulcan.prototype.getTargetSpecifiers = function()
{
var params = {};
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetTargetSpecifiers", JSON.stringify(params)));
};
/**
* Launches a CC application on the local machine, if it is not already running.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @param focus True to launch in foreground, or false to launch in the background.
* @param cmdLine Optional, command-line parameters to supply to the launch command.
* @return True if the app can be launched, false otherwise.
*/
Vulcan.prototype.launchApp = function(targetSpecifier, focus, cmdLine)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
params.focus = focus ? "true" : "false";
params.cmdLine = requiredParamsValid(cmdLine) ? cmdLine : "";
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanLaunchApp", JSON.stringify(params))).result;
};
/**
* Checks whether a CC application is running on the local machine.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return True if the app is running, false otherwise.
*/
Vulcan.prototype.isAppRunning = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppRunning", JSON.stringify(params))).result;
};
/**
* Checks whether a CC application is installed on the local machine.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return True if the app is installed, false otherwise.
*/
Vulcan.prototype.isAppInstalled = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return false;
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppInstalled", JSON.stringify(params))).result;
};
/**
* Retrieves the local install path of a CC application.
*
* @param targetSpecifier The application specifier; for example "indesign".
*
* Note: In Windows 7 64-bit or Windows 8 64-bit system, some target applications (like Photoshop and Illustrator) have both 32-bit version
* and 64-bit version. Therefore, we need to specify the version by this parameter with "photoshop-70.032" or "photoshop-70.064". If you
* installed Photoshop 32-bit and 64-bit on one Windows 64-bit system and invoke this interface with parameter "photoshop-70.032", you may
* receive wrong result.
* The specifiers for Illustrator is "illustrator-17.032", "illustrator-17.064", "illustrator-17" and "illustrator".
*
* In other platforms there is no such issue, so we can use "photoshop" or "photoshop-70" as specifier.
* @return The path string if the application is found, "" otherwise.
*/
Vulcan.prototype.getAppPath = function(targetSpecifier)
{
if(!requiredParamsValid(targetSpecifier))
{
return "";
}
var params = {};
params.targetSpecifier = targetSpecifier;
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetAppPath", JSON.stringify(params))).result;
};
/**
* Registers a message listener callback function for a Vulcan message.
*
* @param type The message type.
* @param callback The callback function that handles the message.
* Takes one argument, the message object.
* @param obj Optional, the object containing the callback method, if any.
* Default is null.
*/
Vulcan.prototype.addMessageListener = function(type, callback, obj)
{
if(!requiredParamsValid(type, callback) || !strStartsWith(type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
params.type = type;
window.__adobe_cep__.invokeAsync("vulcanAddMessageListener", JSON.stringify(params), callback, obj);
};
/**
* Removes a registered message listener callback function for a Vulcan message.
*
* @param type The message type.
* @param callback The callback function that was registered.
* Takes one argument, the message object.
* @param obj Optional, the object containing the callback method, if any.
* Default is null.
*/
Vulcan.prototype.removeMessageListener = function(type, callback, obj)
{
if(!requiredParamsValid(type, callback) || !strStartsWith(type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
params.type = type;
window.__adobe_cep__.invokeAsync("vulcanRemoveMessageListener", JSON.stringify(params), callback, obj);
};
/**
* Dispatches a Vulcan message.
*
* @param vulcanMessage The message object.
*/
Vulcan.prototype.dispatchMessage = function(vulcanMessage)
{
if(!requiredParamsValid(vulcanMessage) || !strStartsWith(vulcanMessage.type, VulcanMessage.TYPE_PREFIX))
{
return;
}
var params = {};
var message = new VulcanMessage(vulcanMessage.type);
message.initialize(vulcanMessage);
params.vulcanMessage = message;
window.__adobe_cep__.invokeSync("vulcanDispatchMessage", JSON.stringify(params));
};
/**
* Retrieves the message payload of a Vulcan message for the registered message listener callback function.
*
* @param vulcanMessage The message object.
* @return A string containing the message payload.
*/
Vulcan.prototype.getPayload = function(vulcanMessage)
{
if(!requiredParamsValid(vulcanMessage) || !strStartsWith(vulcanMessage.type, VulcanMessage.TYPE_PREFIX))
{
return null;
}
var message = new VulcanMessage(vulcanMessage.type);
message.initialize(vulcanMessage);
return message.getPayload();
};
/**
* Gets all available endpoints of the running Vulcan-enabled applications.
*
* Since 7.0.0
*
* @return The array of all available endpoints.
* An example endpoint string:
* <endPoint>
* <appId>PHXS</appId>
* <appVersion>16.1.0</appVersion>
* </endPoint>
*/
Vulcan.prototype.getEndPoints = function()
{
var params = {};
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetEndPoints", JSON.stringify(params)));
};
/**
* Gets the endpoint for itself.
*
* Since 7.0.0
*
* @return The endpoint string for itself.
*/
Vulcan.prototype.getSelfEndPoint = function()
{
var params = {};
return window.__adobe_cep__.invokeSync("vulcanGetSelfEndPoint", JSON.stringify(params));
};
/** Singleton instance of Vulcan **/
var VulcanInterface = new Vulcan();
//--------------------------------- Vulcan Message ------------------------------
/**
* @class VulcanMessage
* Message type for sending messages between host applications.
* A message of this type can be sent to the designated destination
* when appId and appVersion are provided and valid. Otherwise,
* the message is broadcast to all running Vulcan-enabled applications.
*
* To send a message between extensions running within one
* application, use the <code>CSEvent</code> type in CSInterface.js.
*
* @param type The message type.
* @param appId The peer appId.
* @param appVersion The peer appVersion.
*
*/
function VulcanMessage(type, appId, appVersion)
{
this.type = type;
this.scope = VulcanMessage.SCOPE_SUITE;
this.appId = requiredParamsValid(appId) ? appId : VulcanMessage.DEFAULT_APP_ID;
this.appVersion = requiredParamsValid(appVersion) ? appVersion : VulcanMessage.DEFAULT_APP_VERSION;
this.data = VulcanMessage.DEFAULT_DATA;
}
VulcanMessage.TYPE_PREFIX = "vulcan.SuiteMessage.";
VulcanMessage.SCOPE_SUITE = "GLOBAL";
VulcanMessage.DEFAULT_APP_ID = "UNKNOWN";
VulcanMessage.DEFAULT_APP_VERSION = "UNKNOWN";
VulcanMessage.DEFAULT_DATA = "<data><payload></payload></data>";
VulcanMessage.dataTemplate = "<data>{0}</data>";
VulcanMessage.payloadTemplate = "<payload>{0}</payload>";
/**
* Initializes this message instance.
*
* @param message A \c message instance to use for initialization.
*/
VulcanMessage.prototype.initialize = function(message)
{
this.type = message.type;
this.scope = message.scope;
this.appId = message.appId;
this.appVersion = message.appVersion;
this.data = message.data;
};
/**
* Retrieves the message data.
*
* @return A data string in XML format.
*/
VulcanMessage.prototype.xmlData = function()
{
if(this.data === undefined)
{
var str = "";
str = String.format(VulcanMessage.payloadTemplate, str);
this.data = String.format(VulcanMessage.dataTemplate, str);
}
return this.data;
};
/**
* Sets the message payload of this message.
*
* @param payload A string containing the message payload.
*/
VulcanMessage.prototype.setPayload = function(payload)
{
var str = cep.encoding.convertion.utf8_to_b64(payload);
str = String.format(VulcanMessage.payloadTemplate, str);
this.data = String.format(VulcanMessage.dataTemplate, str);
};
/**
* Retrieves the message payload of this message.
*
* @return A string containing the message payload.
*/
VulcanMessage.prototype.getPayload = function()
{
var str = GetValueByKey(this.data, "payload");
if(str !== null)
{
return cep.encoding.convertion.b64_to_utf8(str);
}
return null;
};
/**
* Converts the properties of this instance to a string.
*
* @return The string version of this instance.
*/
VulcanMessage.prototype.toString = function()
{
var str = "type=" + this.type;
str += ", scope=" + this.scope;
str += ", appId=" + this.appId;
str += ", appVersion=" + this.appVersion;
str += ", data=" + this.xmlData();
return str;
};
//--------------------------------------- Util --------------------------------
/**
* Formats a string based on a template.
*
* @param src The format template.
*
* @return The formatted string
*/
String.format = function(src)
{
if (arguments.length === 0)
{
return null;
}
var args = Array.prototype.slice.call(arguments, 1);
return src.replace(/\{(\d+)\}/g, function(m, i){
return args[i];
});
};
/**
* Retrieves the content of an XML element.
*
* @param xmlStr The XML string.
* @param key The name of the tag.
*
* @return The content of the tag, or the empty string
* if such tag is not found or the tag has no content.
*/
function GetValueByKey(xmlStr, key)
{
if(window.DOMParser)
{
var parser = new window.DOMParser();
try
{
var xmlDoc = parser.parseFromString(xmlStr, "text/xml");
var node = xmlDoc.getElementsByTagName(key)[0];
if(node && node.childNodes[0])
{
return node.childNodes[0].nodeValue;
}
}
catch(e)
{
//log the error
}
}
return "";
}
/**
* Reports whether required parameters are valid.
*
* @return True if all required parameters are valid,
* false if any of the required parameters are invalid.
*/
function requiredParamsValid()
{
for(var i = 0; i < arguments.length; i++)
{
var argument = arguments[i];
if(argument === undefined || argument === null)
{
return false;
}
}
return true;
}
/**
* Reports whether a string has a given prefix.
*
* @param str The target string.
* @param prefix The specific prefix string.
*
* @return True if the string has the prefix, false if not.
*/
function strStartsWith(str, prefix)
{
if(typeof str != "string")
{
return false;
}
return str.indexOf(prefix) === 0;
}

View file

@ -1,4 +0,0 @@
// switch between live and local code
function onLoaded() {
window.location.href = "http://localhost:8021/ppro/index.html";
}

File diff suppressed because it is too large Load diff

View file

@ -1,534 +0,0 @@
// json2.js
// 2017-06-12
// Public Domain.
// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
// NOT CONTROL.
// This file creates a global JSON object containing two methods: stringify
// and parse. This file provides the ES5 JSON capability to ES3 systems.
// If a project might run on IE8 or earlier, then this file should be included.
// This file does nothing on ES5 systems.
// JSON.stringify(value, replacer, space)
// value any JavaScript value, usually an object or array.
// replacer an optional parameter that determines how object
// values are stringified for objects. It can be a
// function or an array of strings.
// space an optional parameter that specifies the indentation
// of nested structures. If it is omitted, the text will
// be packed without extra whitespace. If it is a number,
// it will specify the number of spaces to indent at each
// level. If it is a string (such as "\t" or "&nbsp;"),
// it contains the characters used to indent at each level.
// This method produces a JSON text from a JavaScript value.
// When an object value is found, if the object contains a toJSON
// method, its toJSON method will be called and the result will be
// stringified. A toJSON method does not serialize: it returns the
// value represented by the name/value pair that should be serialized,
// or undefined if nothing should be serialized. The toJSON method
// will be passed the key associated with the value, and this will be
// bound to the value.
// For example, this would serialize Dates as ISO strings.
// Date.prototype.toJSON = function (key) {
// function f(n) {
// // Format integers to have at least two digits.
// return (n < 10)
// ? "0" + n
// : n;
// }
// return this.getUTCFullYear() + "-" +
// f(this.getUTCMonth() + 1) + "-" +
// f(this.getUTCDate()) + "T" +
// f(this.getUTCHours()) + ":" +
// f(this.getUTCMinutes()) + ":" +
// f(this.getUTCSeconds()) + "Z";
// };
// You can provide an optional replacer method. It will be passed the
// key and value of each member, with this bound to the containing
// object. The value that is returned from your method will be
// serialized. If your method returns undefined, then the member will
// be excluded from the serialization.
// If the replacer parameter is an array of strings, then it will be
// used to select the members to be serialized. It filters the results
// such that only members with keys listed in the replacer array are
// stringified.
// Values that do not have JSON representations, such as undefined or
// functions, will not be serialized. Such values in objects will be
// dropped; in arrays they will be replaced with null. You can use
// a replacer function to replace those with JSON values.
// JSON.stringify(undefined) returns undefined.
// The optional space parameter produces a stringification of the
// value that is filled with line breaks and indentation to make it
// easier to read.
// If the space parameter is a non-empty string, then that string will
// be used for indentation. If the space parameter is a number, then
// the indentation will be that many spaces.
// Example:
// text = JSON.stringify(["e", {pluribus: "unum"}]);
// // text is '["e",{"pluribus":"unum"}]'
// text = JSON.stringify(["e", {pluribus: "unum"}], null, "\t");
// // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
// text = JSON.stringify([new Date()], function (key, value) {
// return this[key] instanceof Date
// ? "Date(" + this[key] + ")"
// : value;
// });
// // text is '["Date(---current time---)"]'
// JSON.parse(text, reviver)
// This method parses a JSON text to produce an object or array.
// It can throw a SyntaxError exception.
// The optional reviver parameter is a function that can filter and
// transform the results. It receives each of the keys and values,
// and its return value is used instead of the original value.
// If it returns what it received, then the structure is not modified.
// If it returns undefined then the member is deleted.
// Example:
// // Parse the text. Values that look like ISO date strings will
// // be converted to Date objects.
// myData = JSON.parse(text, function (key, value) {
// var a;
// if (typeof value === "string") {
// a =
// /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
// if (a) {
// return new Date(Date.UTC(
// +a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6]
// ));
// }
// return value;
// }
// });
// myData = JSON.parse(
// "[\"Date(09/09/2001)\"]",
// function (key, value) {
// var d;
// if (
// typeof value === "string"
// && value.slice(0, 5) === "Date("
// && value.slice(-1) === ")"
// ) {
// d = new Date(value.slice(5, -1));
// if (d) {
// return d;
// }
// }
// return value;
// }
// );
// This is a reference implementation. You are free to copy, modify, or
// redistribute.
/*jslint
eval, for, this
*/
/*property
JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, prototype, push, replace, slice, stringify,
test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
if (typeof JSON !== "object") {
JSON = {};
}
(function () {
"use strict";
var rx_one = /^[\],:{}\s]*$/;
var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
var rx_four = /(?:^|:|,)(?:\s*\[)+/g;
var rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
function f(n) {
// Format integers to have at least two digits.
return (n < 10) ?
"0" + n :
n;
}
function this_value() {
return this.valueOf();
}
if (typeof Date.prototype.toJSON !== "function") {
Date.prototype.toJSON = function () {
return isFinite(this.valueOf()) ?
(
this.getUTCFullYear() +
"-" +
f(this.getUTCMonth() + 1) +
"-" +
f(this.getUTCDate()) +
"T" +
f(this.getUTCHours()) +
":" +
f(this.getUTCMinutes()) +
":" +
f(this.getUTCSeconds()) +
"Z"
) :
null;
};
Boolean.prototype.toJSON = this_value;
Number.prototype.toJSON = this_value;
String.prototype.toJSON = this_value;
}
var gap;
var indent;
var meta;
var rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
rx_escapable.lastIndex = 0;
return rx_escapable.test(string) ?
"\"" + string.replace(rx_escapable, function (a) {
var c = meta[a];
return typeof c === "string" ?
c :
"\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
}) + "\"" :
"\"" + string + "\"";
}
function str(key, holder) {
// Produce a string from holder[key].
var i; // The loop counter.
var k; // The member key.
var v; // The member value.
var length;
var mind = gap;
var partial;
var value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (
value &&
typeof value === "object" &&
typeof value.toJSON === "function"
) {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === "function") {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case "string":
return quote(value);
case "number":
// JSON numbers must be finite. Encode non-finite numbers as null.
return (isFinite(value)) ?
String(value) :
"null";
case "boolean":
case "null":
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce "null". The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is "object", we might be dealing with an object or an array or
// null.
case "object":
// Due to a specification blunder in ECMAScript, typeof null is "object",
// so watch out for that case.
if (!value) {
return "null";
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === "[object Array]") {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || "null";
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0 ?
"[]" :
gap ?
(
"[\n" +
gap +
partial.join(",\n" + gap) +
"\n" +
mind +
"]"
) :
"[" + partial.join(",") + "]";
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === "object") {
length = rep.length;
for (i = 0; i < length; i += 1) {
if (typeof rep[i] === "string") {
k = rep[i];
v = str(k, value);
if (v) {
partial.push(quote(k) + (
(gap) ?
": " :
":"
) + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (
(gap) ?
": " :
":"
) + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0 ?
"{}" :
gap ?
"{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" :
"{" + partial.join(",") + "}";
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== "function") {
meta = { // table of character substitutions
"\b": "\\b",
"\t": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
"\"": "\\\"",
"\\": "\\\\"
};
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = "";
indent = "";
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === "number") {
for (i = 0; i < space; i += 1) {
indent += " ";
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === "string") {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== "function" && (
typeof replacer !== "object" ||
typeof replacer.length !== "number"
)) {
throw new Error("JSON.stringify");
}
// Make a fake root object containing our value under the key of "".
// Return the result of stringifying the value.
return str("", {
"": value
});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== "function") {
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k;
var v;
var value = holder[key];
if (value && typeof value === "object") {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
rx_dangerous.lastIndex = 0;
if (rx_dangerous.test(text)) {
text = text.replace(rx_dangerous, function (a) {
return (
"\\u" +
("0000" + a.charCodeAt(0).toString(16)).slice(-4)
);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with "()" and "new"
// because they can cause invocation, and "=" because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with "@" (a non-JSON character). Second, we
// replace all simple value tokens with "]" characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or "]" or
// "," or ":" or "{" or "}". If that is so, then the text is safe for eval.
if (
rx_one.test(
text
.replace(rx_two, "@")
.replace(rx_three, "]")
.replace(rx_four, "")
)
) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The "{" operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval("(" + text + ")");
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return (typeof reviver === "function") ?
walk({
"": j
}, "") :
j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError("JSON.parse");
};
}
}());

View file

@ -1,30 +0,0 @@
{
"name": "com.pype",
"version": "1.0.0",
"description": "pype avalon integration",
"license": "ISC",
"main": "CSXS\\manifest.xml",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"bluebird": "^3.7.2",
"decompress-zip": "^0.2.2",
"fs": "^0.0.1-security",
"jsonfile": "^6.0.1",
"junk": "^3.1.0",
"mkdirp": "^1.0.4",
"node-fetch": "^2.6.0",
"node-timecodes": "^2.5.0",
"opn": "^6.0.0",
"os": "^0.1.1",
"path": "^0.12.7",
"process": "^0.11.10",
"pure-uuid": "^1.6.0",
"rimraf": "^3.0.2",
"url": "^0.11.0",
"walk": "^2.3.14",
"xml2js": "^0.4.23"
},
"devDependencies": {}
}

View file

@ -1,15 +0,0 @@
/* global $, File, Folder, alert */
if (typeof ($) === 'undefined') {
var $ = {};
}
if (typeof (app) === 'undefined') {
var app = {};
}
function keepExtention () {
return app.setExtensionPersistent('com.pype', 0);
}
keepExtention();

View file

@ -1,193 +0,0 @@
import os
import sys
import shutil
import json
from pysync import walktree
import requests
from avalon import api
from pype.widgets.message_window import message
from pype import PLUGINS_DIR
from pype.api import Logger
log = Logger().get_logger(__name__)
self = sys.modules[__name__]
self._has_been_setup = False
self._registered_gui = None
AVALON_CONFIG = os.environ["AVALON_CONFIG"]
PARENT_DIR = os.path.dirname(__file__)
self.EXTENSIONS_PATH_REMOTE = os.path.join(PARENT_DIR, "extensions")
self.EXTENSIONS_PATH_LOCAL = None
self.EXTENSIONS_CACHE_PATH = None
self.LOAD_PATH = os.path.join(PLUGINS_DIR, "premiere", "load")
self.CREATE_PATH = os.path.join(PLUGINS_DIR, "premiere", "create")
self.INVENTORY_PATH = os.path.join(PLUGINS_DIR, "premiere", "inventory")
self.PUBLISH_PATH = os.path.join(
PLUGINS_DIR, "premiere", "publish"
).replace("\\", "/")
if os.getenv("PUBLISH_PATH", None):
if self.PUBLISH_PATH not in os.environ["PUBLISH_PATH"]:
os.environ["PUBLISH_PATH"] = os.pathsep.join(
os.environ["PUBLISH_PATH"].split(os.pathsep) +
[self.PUBLISH_PATH]
)
else:
os.environ["PUBLISH_PATH"] = self.PUBLISH_PATH
_clearing_cache = ["com.pype", "com.pype.rename"]
def ls():
pass
def reload_pipeline():
"""Attempt to reload pipeline at run-time.
CAUTION: This is primarily for development and debugging purposes.
"""
import importlib
import pype.hosts.premiere
api.uninstall()
for module in ("avalon.io",
"avalon.lib",
"avalon.pipeline",
"avalon.api",
"avalon.tools",
"{}".format(AVALON_CONFIG),
"{}.premiere".format(AVALON_CONFIG),
"{}.premiere.lib".format(AVALON_CONFIG)
):
log.info("Reloading module: {}...".format(module))
try:
module = importlib.import_module(module)
importlib.reload(module)
except Exception as e:
log.warning("Cannot reload module: {}".format(e))
api.install(pype.hosts.premiere)
def setup(env=None):
""" Running wrapper
"""
if not env:
env = os.environ
self.EXTENSIONS_PATH_LOCAL = env["EXTENSIONS_PATH"]
self.EXTENSIONS_CACHE_PATH = env["EXTENSIONS_CACHE_PATH"]
log.info("Registering Adobe Premiere plug-ins..")
if not test_rest_api_server(env):
return
if not env.get("installed_zxp"):
# remove cep_cache from user temp dir
clearing_caches_ui()
# synchronize extensions
extensions_sync()
else:
log.info("Extensions installed as `.zxp`...")
log.info("Premiere Pype wrapper has been installed")
def extensions_sync():
# TODO(antirotor): Bundle extension and install it
# we need to bundle extension as we are using third party node_modules
# to ease creation of bundle, lets create build script creating self-signed
# certificate and bundling extension to zxp format (using ZXPSignCmd from
# Adobe). If we find zxp in extension directory, we can install it via
# command line `ExManCmd /install` - using Adobe Extension Manager. If
# zxp is not found, we use old behaviour and just copy all files. Thus we
# maintain ability to develop and deploy at the same time.
#
# sources:
# https://helpx.adobe.com/extension-manager/using/command-line.html
process_pairs = list()
# get extensions dir in pype.hosts.premiere.extensions
# build dir path to premiere cep extensions
for name in os.listdir(self.EXTENSIONS_PATH_REMOTE):
log.debug("> name: {}".format(name))
src = os.path.join(self.EXTENSIONS_PATH_REMOTE, name)
dst = os.path.join(self.EXTENSIONS_PATH_LOCAL, name)
process_pairs.append((name, src, dst))
# synchronize all extensions
for name, src, dst in process_pairs:
if not os.path.isdir(src):
continue
if name not in _clearing_cache:
continue
if not os.path.exists(dst):
os.makedirs(dst, mode=0o777)
walktree(source=src, target=dst, options_input=["y", ">"])
log.info("Extension {0} from `{1}` copied to `{2}`".format(
name, src, dst
))
# time.sleep(10)
return
def clearing_caches_ui():
'''Before every start of premiere it will make sure there is not
outdated stuff in cep_cache dir'''
if not os.path.isdir(self.EXTENSIONS_CACHE_PATH):
os.makedirs(self.EXTENSIONS_CACHE_PATH, mode=0o777)
log.info("Created dir: {}".format(self.EXTENSIONS_CACHE_PATH))
for d in os.listdir(self.EXTENSIONS_CACHE_PATH):
match = [p for p in _clearing_cache
if str(p) in d]
if match:
try:
path = os.path.normpath(
os.path.join(self.EXTENSIONS_CACHE_PATH, d))
log.info("Removing dir: {}".format(path))
shutil.rmtree(path, ignore_errors=True)
except Exception as e:
log.error("problem: {}".format(e))
def test_rest_api_server(env):
# from pprint import pformat
rest_url = env.get("PYPE_WEBSERVER_URL")
project_name = "{AVALON_PROJECT}".format(**env)
URL = "/".join((rest_url,
"avalon/projects",
project_name))
log.debug("__ URL: {}".format(URL))
try:
req = requests.get(URL, data={}).text
req_json = json.loads(req)
# log.debug("_ req_json: {}".format(pformat(req_json)))
log.debug("__ projectName: {}".format(req_json["data"]["name"]))
assert req_json["data"]["name"] == project_name, (
"Project data from Rest API server not correct")
return True
except Exception as e:
message(title="Pype Rest API static server is not running ",
message=("Before you can run Premiere, make sure "
"the system Tray Pype icon is running and "
"submenu `service` with name `Rest API` is "
"with green icon."
"\n Error: {}".format(e)),
level="critical")

View file

@ -1,28 +0,0 @@
body {
background-color: #323238;
color: #eeeeee
}
#output {
background: #121212;
color: #eeeeee;
padding: 2em;
font-family: monospace;
font-weight: bold;
min-height: 8em
}
#output.error {
background: #FF0000;
color: #000000;
padding: 2em;
font-family: monospace;
font-weight: bold;
min-height: 8em
}
.dark>.list-group-item {
background: #454747
}
/*# sourceMappingURL=avalon.min.css.map */

View file

@ -1,9 +0,0 @@
{
"version": 3,
"file": "avalon.min.css",
"sources": [
"avalon.scss"
],
"names": [],
"mappings": "AAAA,AAAA,IAAI,AAAC,CACH,gBAAgB,CAAE,OAAO,CACzB,KAAK,CAAE,OAAO,CACf,AAED,AAAA,OAAO,AAAC,CACN,UAAU,CAAE,OAAO,CACnB,KAAK,CAAE,OAAO,CACd,OAAO,CAAE,GAAG,CACZ,WAAW,CAAE,SAAS,CACtB,WAAW,CAAE,IAAI,CACjB,UAAU,CAAE,GAAG,CAChB,AAED,AAAA,KAAK,CAAG,gBAAgB,AAAC,CACvB,UAAU,CAAE,OAAO,CACpB"
}

View file

@ -1,26 +0,0 @@
body {
background-color: #323238;
color: #eeeeee;
}
#output {
background: #121212;
color: #eeeeee;
padding: 2em;
font-family: monospace;
font-weight: bold;
min-height: 8em;
}
#output.error {
background: #FF0000;
color: #000000;
padding: 2em;
font-family: monospace;
font-weight: bold;
min-height: 8em
}
.dark > .list-group-item {
background: #454747;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,48 +0,0 @@
[0403/172908.369:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.370:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.371:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.371:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/172908.371:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0403/173803.977:ERROR:crash_report_database_win.cc(469)] failed to stat report

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

View file

@ -1,158 +0,0 @@
<!DOCTYPE html>
<html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Pype extention</title>
<link href="./css/bootstrap.min.css" type="text/css" rel="stylesheet">
<link href="./css/avalon.min.css" type="text/css" rel="stylesheet">
<script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
<script src="./js/vendor/jquery-3.3.1.min.js"></script>
<script src="./js/vendor/CSInterface-8.js"></script>
<script src="./js/vendor/popper.min.js"></script>
<script src="./js/vendor/bootstrap.min.js"></script>
<script src="./js/vendor/json2.js"></script>
<script>
if (window.module) module = window.module;
var ENV;
</script>
</head>
<body>
<div id="section">
<a href="javascript:history.go(0)">Refresh panel</a>
<ul class="list-group list-group-flush dark">
<li class="list-group-item" id="rename">
<div class="input-group input-group-sm mb-1">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">
Rename targeted text layers<br />
converts `sc010sh020`<br />
to `proj01ep01sc01sh01`<br />
and creates ftrack metadata</span>
<div class="input-group-text">
<input type="text" name="episode" placeholder="ep01" aria-label="episode" aria-describedby="basic-addon5" value="" style="width:75px;">
</div>
<div class="input-group-text">
<input type="text" name="ep_suffix" placeholder="longerEpisodeName" aria-label="Name of episode" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<button id="btn-rename" type="button" class="btn btn-info btn-sm btn-block">Rename</button>
</div>
</div>
</li>
<li class="list-group-item" id="publish">
<h5>Publish</h5>
<pre><code class="js"></code></pre>
<div class="input-group input-group-lg mb-4">
<!-- <div class="input-group-prepend"> <span class="input-group-text" id="basic-addon6">GUI</span> <div class="input-group-text"> <input type="checkbox" name="gui" checked="checked" aria-label="Checkbox for following text input"> </div> </div> -->
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Version Up</span>
<div class="input-group-text">
<input type="checkbox" name="version-up" checked="checked" aria-label="Checkbox for following text input">
</div>
<span class="input-group-text" id="basic-addon6">
Audio Only</span>
<div class="input-group-text">
<input type="checkbox" name="audio-only" aria-label="Check if you want to export only audio">
</div>
</div>
<div class="input-group-append">
<button id="btn-publish" type="button" class="btn btn-info btn-sm btn-block">Publish</button>
</div>
</div>
<div class="input-group input-group-sm mb-1">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Path to sending data json</span>
<div class="input-group-text">
<input type="text" name="send-path" placeholder="Path" aria-label="Path" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<button id="btn-send-reset" type="button" class="btn btn-info btn-sm btn-block">Reset</button>
</div>
</div>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Path to getting data json</span>
<div class="input-group-text">
<input type="text" name="get-path" placeholder="Path" aria-label="Path" aria-describedby="basic-addon5" value="">
</div>
</div>
<div class="input-group-append">
<button id="btn-get-reset" type="button" class="btn btn-info btn-sm btn-block">Reset</button>
</div>
<!-- <div class="input-group-append">
<button id="btn-metadata" type="button" class="btn btn-info btn-sm btn-block">Injest metadata</button>
</div> -->
</div>
</li>
<li class="list-group-item">
<button type="button" class="btn btn-info btn-sm btn-block" id="btn-newWorkfileVersion">Save next workfile version</button>
</li>
<li class="list-group-item">
<button type="button" class="btn btn-info btn-sm btn-block" id="btn-get-frame">Get screen grab</button>
</li>
<!-- <li class="list-group-item" id="load">
<h5>Load/Update assets to timeline</h5>
<pre><code class="js"></code></pre>
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon6">Type</span>
<div class="input-group-text">
<input type="text" name="type" placeholder="renderAnimation" aria-label="Asset Type" aria-describedby="basic-addon5" value="renderAnimation">
</div>
<span class="input-group-text" id="basic-addon6">Ext</span>
<div class="input-group-text">
<input type="text" name="ext" placeholder="mxf" aria-label="File Extension" aria-describedby="basic-addon5" value="mxf">
</div>
<div class="input-group-append">
<button type="button" class="btn btn-info btn-sm btn-block" id="btn-getRernderAnimation">DO IT!</button>
</div>
</div>
</li> -->
</ul>
<hr />
<div class="col-md-6" id="source">
<!-- <pre> <code class="python"></code> </pre> -->
</div>
<h5>Output</h5>
<div id="output"></div>
<script src="./js/pype_restapi_client.js"></script>
<script src="./js/pype.js"></script>
</body>
</html>

View file

@ -1,69 +0,0 @@
{
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "script",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"constructor-super": 2,
"for-direction": 2,
"getter-return": 2,
"no-async-promise-executor": 2,
"no-case-declarations": 2,
"no-class-assign": 2,
"no-compare-neg-zero": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-constant-condition": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty": 2,
"no-empty-character-class": 2,
"no-empty-pattern": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-semi": 2,
"no-fallthrough": 2,
"no-func-assign": 2,
"no-global-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-misleading-character-class": 2,
"no-mixed-spaces-and-tabs": 2,
"no-new-symbol": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-prototype-builtins": 2,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-self-assign": 2,
"no-shadow-restricted-names": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-undef": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"no-unsafe-finally": 2,
"no-unsafe-negation": 2,
"no-unused-labels": 2,
"no-unused-vars": 2,
"no-useless-catch": 2,
"no-useless-escape": 2,
"no-with": 2,
"require-yield": 2,
"use-isnan": 2,
"valid-typeof": 2
},
"env": {
"es2017": false,
"node": true
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,345 +0,0 @@
/* global CSInterface, $, PypeRestApiClient, SystemPath */
/* eslint-env node, es2017, esversion:6 */
class Pype {
/**
* Initialize important properties and load necessary JSX files.
*/
constructor() {
this.csi = new CSInterface();
this.outputId = $("#output");
this.rootFolderPath = this.csi.getSystemPath(SystemPath.EXTENSION);
var extensionRoot = this.rootFolderPath + "/jsx/";
this.progress("Loading premiere.jsx", true);
this.csi.evalScript('$.evalFile("' + extensionRoot + '/PPRO/Premiere.jsx");', () => {
this.progress("Loading pype.jsx", true);
this.csi.evalScript('$.evalFile("' + extensionRoot + 'pype.jsx");', () => {
this.progress("Loading batchRenamer.jsx", true);
this.csi.evalScript('$.evalFile("' + extensionRoot + 'batchRenamer.jsx");', () => {
this._initialize();
});
});
});
}
_initialize() {
var self = this;
// get environment
this.csi.evalScript('$.pype.getProjectFileData();', (result) => {
if (result == "EvalScript error.") {
this.error("Cannot get project data.");
throw "Cannot get project data";
}
process.env.EXTENSION_PATH = this.rootFolderPath;
this.env = process.env;
var resultData = JSON.parse(result);
for (var key in resultData) {
this.env[key] = resultData[key];
}
this.csi.evalScript('$.pype.setEnvs(' + JSON.stringify(self.env) + ')');
this.pras = new PypeRestApiClient(this.env);
this.progress(`Getting presets for ${this.env.AVALON_PROJECT}`, true);
this.presets = this.pras.get_presets(this.env.AVALON_PROJECT)
.then((presets) => {
this.progress("transferring presets to jsx")
this.presets = presets;
this.csi.evalScript('$.pype.setProjectPreset(' + JSON.stringify(presets) + ');', () => {
this.progress("Panel's backend loaded...", true);
// bind encoding jobs event listener
this.csi.addEventListener("pype.EncoderJobsComplete", this._encodingDone);
// Bind Interface buttons
this._bindButtons();
});
});
});
}
/**
* Wrapper function over clip renamer
*/
rename () {
let $renameId = $('#rename');
let data = {};
data.ep = $('input[name=episode]', $renameId).val();
data.epSuffix = $('input[name=ep_suffix]', $renameId).val();
data.projectCode = this.env.AVALON_PROJECT_CODE;
if (!data.ep) {
this.csi.evalScript('$.pype.alert_message("' + 'Need to fill episode code' + '")');
return;
}
if (!data.epSuffix) {
this.csi.evalScript('$.pype.alert_message("' + 'Need to fill episode longer suffix' + '")');
return;
}
this.progress(`Doing rename [ ${data.ep} ] | [ ${data.epSuffix} ]`);
this.csi.evalScript(
'BatchRenamer.renameTargetedTextLayer(' + JSON.stringify(data) + ' );', (result) => {
this.progress(`Renaming result: ${result}`, true);
});
}
_bindButtons() {
var self = this;
$('#btn-publish').click(function () {
self.publish();
});
$('#btn-rename').click(function () {
self.rename();
});
$('#btn-send-reset').click(function () {
$('#publish input[name=send-path]').val("");
});
$('#btn-get-reset').click(function () {
$('#publish input[name=get-path]').val("");
});
$('#btn-newWorkfileVersion').click(function () {
self.csi.evalScript('$.pype.versionUpWorkFile();');
self.progress('New version of the project file saved...', true);
});
$('#btn-get-frame').click(function () {
self.csi.evalScript('$._PPP_.exportCurrentFrameAsPNG();', (result) => {
self.progress(`Screen grabing image path in: [${result}]`, true);
});
});
}
/**
* Normalize slashes in path string
* @param {String} path
*/
static convertPathString (path) {
return path.replace(
new RegExp('\\\\', 'g'), '/').replace(new RegExp('//\\?/', 'g'), '');
}
/**
* Gather all user UI options for publishing
*/
_gatherPublishUI() {
let publishId = $('#publish');
let uiVersionUp = $('input[name=version-up]', publishId);
let uiAudioOnly = $('input[name=audio-only]', publishId);
let uiJsonSendPath = $('input[name=send-path]', publishId);
let uiJsonGetPath = $('input[name=get-path]', publishId);
this.publishUI = {
"versionUp": uiVersionUp.prop('checked'),
"audioOnly": uiAudioOnly.prop('checked'),
"jsonSendPath": uiJsonSendPath.val(),
"jsonGetPath": uiJsonGetPath.val()
}
}
_getStagingDir() {
const path = require('path');
const UUID = require('pure-uuid');
const os = require('os');
const id = new UUID(4).format();
return path.join(os.tmpdir(), id);
}
/**
* Create staging directories and copy project files
* @param {object} projectData Project JSON data
*/
_copyProjectFiles(projectData) {
const path = require('path');
const fs = require('fs');
const mkdirp = require('mkdirp');
this.stagingDir = this._getStagingDir();
this.progress(`Creating directory [ ${this.stagingDir} ]`, true);
mkdirp.sync(this.stagingDir);
let stagingDir = Pype.convertPathString(this.stagingDir);
const destination = Pype.convertPathString(
path.join(stagingDir, projectData.projectfile));
this.progress(`Copying files from [ ${projectData.projectpath} ] -> [ ${destination} ]`);
fs.copyFileSync(projectData.projectpath, destination);
this.progress("Project files copied.", true);
}
_encodeRepresentation(repre) {
var self = this;
return new Promise(function(resolve, reject) {
self.csi.evalScript('$.pype.encodeRepresentation(' + JSON.stringify(repre) + ');', (result) => {
if (result == "EvalScript error.") {
reject(result);
}
self.progress("Encoding files to Encoder queue submitted ...", true);
const jsonfile = require('jsonfile');
let jsonContent = JSON.parse(result);
if (self.publishUI.jsonSendPath == "") {
self.publishUI.jsonSendPath = self.stagingDir + "\\publishSend.json";
$('#publish input[name=send-path]').val(self.publishUI.jsonSendPath);
}
if (self.publishUI.jsonGetPath == "") {
self.publishUI.jsonGetPath = self.stagingDir + "_publishGet.json";
$('#publish input[name=get-path]').val(self.publishUI.jsonGetPath);
}
jsonfile.writeFile(self.publishUI.jsonSendPath, jsonContent);
resolve(result);
});
});
}
_getPyblishRequest(stagingDir) {
var self = this;
return new Promise(function(resolve, reject) {
self.csi.evalScript("$.pype.getPyblishRequest('" + stagingDir + "', '" + self.publishUI.audioOnly + "');", (result) => {
if (result === "null" || result === "EvalScript error.") {
self.error(`cannot create publish request data ${result}`);
reject("cannot create publish request data");
} else {
console.log(`Request generated: ${result}`);
resolve(result);
}
});
});
}
publish() {
this._gatherPublishUI();
if (this.publishUI.jsonSendPath === "") {
// path is empty, so we first prepare data for publishing
// and create json
this.progress("Gathering project data ...", true);
this.csi.evalScript('$.pype.getProjectFileData();', (result) => {
this._copyProjectFiles(JSON.parse(result))
// create request and start encoding
// after that is done, we should recieve event and continue in
// _encodingDone()
this.progress("Creating publishing request ...", true)
this._getPyblishRequest(Pype.convertPathString(this.stagingDir))
.then(result => {
this.progress('Encoding ...');
this._encodeRepresentation(JSON.parse(result))
.then(result => {
console.log('printing result from enconding.. ' + result);
})
.catch(error => {
this.error(`failed to encode: ${error}`);
});
}, error => {
this.error(`failed to publish: ${error}`);
});
this.progress("Waiting for result ...");
});
} else {
// load request
var dataToPublish = {
"adobePublishJsonPathSend": this.publishUI.jsonSendPath,
"adobePublishJsonPathGet": this.publishUI.jsonGetPath,
"project": this.env.AVALON_PROJECT,
"asset": this.env.AVALON_ASSET,
"task": this.env.AVALON_TASK,
"workdir": Pype.convertPathString(this.env.AVALON_WORKDIR),
"AVALON_APP": this.env.AVALON_APP,
"AVALON_APP_NAME": this.env.AVALON_APP_NAME
}
// C:\Users\jezsc\AppData\Local\Temp\4c56ba52-8839-44de-b327-0187c79d0814\publishSend.json
this.pras.publish(JSON.stringify(dataToPublish))
.then((result) => {
const fs = require('fs');
if (fs.existsSync(result.return_data_path)) {
if (this.publishUI.versionUp) {
this.progress('Saving new version of the project file', true);
this.csi.evalScript('$.pype.versionUpWorkFile();');
}
// here jsonSetPath and jsonGetPath are set to gui
$('#publish input[name=send-path]').val("");
$('#publish input[name=get-path]').val("");
this.progress("Publishing done.", true);
} else {
this.error("Publish has not finished correctly");
throw "Publish has not finished correctly";
}
}, (error) => {
this.error("Invalid response from server");
console.error(error);
});
}
}
_encodingDone(event) {
// this will be global in this context
console.debug(event);
this.pype.progress("Publishing event after encoding finished recieved ...", true);
var dataToPublish = {
"adobePublishJsonPathSend": this.pype.publishUI.jsonSendPath,
"adobePublishJsonPathGet": this.pype.publishUI.jsonGetPath,
"gui": true,
// "publishPath": Pype.convertPathString(this.pype.env.PUBLISH_PATH),
"project": this.pype.env.AVALON_PROJECT,
"asset": this.pype.env.AVALON_ASSET,
"task": this.pype.env.AVALON_TASK,
"workdir": Pype.convertPathString(this.pype.env.AVALON_WORKDIR),
"AVALON_APP": this.pype.env.AVALON_APP,
"AVALON_APP_NAME": this.pype.env.AVALON_APP_NAME
}
this.pype.progress("Preparing publish ...", true);
console.log(JSON.stringify(dataToPublish));
this.pype.pras.publish(JSON.stringify(dataToPublish))
.then((result) => {
const fs = require('fs');
if (fs.existsSync(result.return_data_path)) {
if (this.pype.publishUI.versionUp) {
this.pype.progress('Saving new version of the project file', true);
this.pype.csi.evalScript('$.pype.versionUpWorkFile();');
}
// here jsonSetPath and jsonGetPath are set to gui
$('#publish input[name=send-path]').val("");
$('#publish input[name=get-path]').val("");
this.pype.progress("Publishing done.", true);
} else {
this.pype.error("Publish has not finished correctly")
throw "Publish has not finished correctly";
}
}, (error) => {
this.pype.error("Invalid response from server");
console.error(error);
});
}
/**
* Display error message in div
* @param {String} message
*/
error(message) {
this.outputId.html(message);
this.outputId.addClass("error");
console.error(message);
}
/**
* Display message in output div. If append is set, new message is appended to rest with <br>
* @param {String} message
* @param {Boolean} append
*/
progress(message, append=false) {
this.outputId.removeClass("error");
if (append) {
this.outputId.prepend(message + "<br/>");
}
console.info(message);
}
}
$(function() {
global.pype = new Pype();
});

View file

@ -1,69 +0,0 @@
/* eslint-env node, es2017, esversion:6 */
// connecting pype module pype rest api server (pras)
class PypeRestApiClient {
constructor(env) {
this.env = env;
}
/**
* Return url for pype rest api server service
* @return {url string}
*/
_getApiServerUrl() {
var url = this.env.PYPE_WEBSERVER_URL;
return url
}
/**
* Return JSON from server. This will wait for result.
* @todo handle status codes and non-json data
* @param {String} url server url
* @param {object} options request options
*/
async getResponseFromRestApiServer(url, options = {}) {
const fetch = require('node-fetch');
let defaults = {
method: "GET",
headers: {
"Content-Type": "application/json"
}
}
let settings = {...defaults, ...options}
const res = await fetch(url, settings);
return await res.json();
}
/**
* Return presets for project from server
* @param {String} projectName
*/
async get_presets(projectName) {
let server = this._getApiServerUrl();
let url = `${server}/adobe/presets/${projectName}`;
console.log("connecting ...");
let response = await this.getResponseFromRestApiServer(url)
console.log("got presets:");
console.log(response.data);
return response.data;
}
async publish(data) {
let server = this._getApiServerUrl();
let url = `${server}/adobe/publish`;
let headers = {
"Content-Type": "application/json"
}
console.log("connecting ...");
let response = await this.getResponseFromRestApiServer(
url, {method: 'POST', headers: headers, body: data});
console.log("got response:");
console.log(response.data);
return response.data;
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,489 +0,0 @@
/*
json2.js
2014-02-04
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
NOT CONTROL.
This file creates a global JSON object containing two methods: stringify
and parse.
JSON.stringify(value, replacer, space)
value any JavaScript value, usually an object or array.
replacer an optional parameter that determines how object
values are stringified for objects. It can be a
function or an array of strings.
space an optional parameter that specifies the indentation
of nested structures. If it is omitted, the text will
be packed without extra whitespace. If it is a number,
it will specify the number of spaces to indent at each
level. If it is a string (such as '\t' or '&nbsp;'),
it contains the characters used to indent at each level.
This method produces a JSON text from a JavaScript value.
When an object value is found, if the object contains a toJSON
method, its toJSON method will be called and the result will be
stringified. A toJSON method does not serialize: it returns the
value represented by the name/value pair that should be serialized,
or undefined if nothing should be serialized. The toJSON method
will be passed the key associated with the value, and this will be
bound to the value
For example, this would serialize Dates as ISO strings.
Date.prototype.toJSON = function (key) {
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
return this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z';
};
You can provide an optional replacer method. It will be passed the
key and value of each member, with this bound to the containing
object. The value that is returned from your method will be
serialized. If your method returns undefined, then the member will
be excluded from the serialization.
If the replacer parameter is an array of strings, then it will be
used to select the members to be serialized. It filters the results
such that only members with keys listed in the replacer array are
stringified.
Values that do not have JSON representations, such as undefined or
functions, will not be serialized. Such values in objects will be
dropped; in arrays they will be replaced with null. You can use
a replacer function to replace those with JSON values.
JSON.stringify(undefined) returns undefined.
The optional space parameter produces a stringification of the
value that is filled with line breaks and indentation to make it
easier to read.
If the space parameter is a non-empty string, then that string will
be used for indentation. If the space parameter is a number, then
the indentation will be that many spaces.
Example:
text = JSON.stringify(['e', {pluribus: 'unum'}]);
// text is '["e",{"pluribus":"unum"}]'
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
text = JSON.stringify([new Date()], function (key, value) {
return this[key] instanceof Date ?
'Date(' + this[key] + ')' : value;
});
// text is '["Date(---current time---)"]'
JSON.parse(text, reviver)
This method parses a JSON text to produce an object or array.
It can throw a SyntaxError exception.
The optional reviver parameter is a function that can filter and
transform the results. It receives each of the keys and values,
and its return value is used instead of the original value.
If it returns what it received, then the structure is not modified.
If it returns undefined then the member is deleted.
Example:
// Parse the text. Values that look like ISO date strings will
// be converted to Date objects.
myData = JSON.parse(text, function (key, value) {
var a;
if (typeof value === 'string') {
a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
if (a) {
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+a[5], +a[6]));
}
}
return value;
});
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
var d;
if (typeof value === 'string' &&
value.slice(0, 5) === 'Date(' &&
value.slice(-1) === ')') {
d = new Date(value.slice(5, -1));
if (d) {
return d;
}
}
return value;
});
This is a reference implementation. You are free to copy, modify, or
redistribute.
*/
/*jslint evil: true, regexp: true */
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, prototype, push, replace, slice, stringify,
test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
if (typeof JSON !== 'object') {
JSON = {};
}
(function () {
'use strict';
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function () {
return isFinite(this.valueOf())
? this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z'
: null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function () {
return this.valueOf();
};
}
var cx,
escapable,
gap,
indent,
meta,
rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
escapable.lastIndex = 0;
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string'
? c
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string + '"';
}
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
k, // The member key.
v, // The member value.
length,
mind = gap,
partial,
value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
// JSON numbers must be finite. Encode non-finite numbers as null.
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is 'object', we might be dealing with an object or an array or
// null.
case 'object':
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
if (!value) {
return 'null';
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0
? '[]'
: gap
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
: '[' + partial.join(',') + ']';
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
if (typeof rep[i] === 'string') {
k = rep[i];
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0
? '{}'
: gap
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
: '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== 'function') {
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
};
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = '';
indent = '';
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === 'string') {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.
return str('', {'': value});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== 'function') {
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval('(' + text + ')');
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return typeof reviver === 'function'
? walk({'': j}, '')
: j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError('JSON.parse');
};
}
}());

File diff suppressed because one or more lines are too long