Wiki

Clone wiki

pleabargains / Palettization Guide

Palettization Guide (these reserved colors are OFF LIMITS for anything but these uses)

AvatarPalletizationGuide.jpg

Palette

Feature Reserved color
hairA #663300
eyeA #666600
skinA #FFCC99
skinB #F49E50
outfitA #E5CCFF
outfitB #70618D

Updated Short Video Tutorial https://youtu.be/Kt7Pdozg-H8

Publishing Scripts

cd src/modules/assets/publishing-scripts/

./publish-scene.sh [Filename]
Example:

#!bash

./publish-scene.sh AllScenarios_Jail_Figure1.js

publish-scene.sh

  • is the main publishing script that runs all the below scripts automatically
  • the component scripts are described below:

palettize.sh Paletization

  • Converts the reserved palette colors to javascript variable names so they can be set dynamically based on subject's avatar customizations.
  • Tested on Linux and Mac OS X (tested with GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17))

prepare-avatar-feature-toggling.sh Adds Feature Toggling to published js animation

  • Generating avatar feature toggling REQUIRES at least Bash 4 (at least on Mac OS X) because the lower/uppercasing features
  • Automatically adds feature (eyes & hair) toggling to javascript animation file published manually out of Adobe Animate. So an Adobe Animate file such as Scenario2_Intro_Figure0.fla, gets published manually as such as Scenario2_Intro_Figure0.js. This script will automatically insert conditional feature toggling (3 hair and eyes currently):

add-lib.sh

  • Conforms the name of lib to expectations of the other javascript code
  • Fixes issue of for Adobe breaking software by changing their JS export in version Adobe Animate 17.5, including de-gobalizing 'lib'.
  • NOTE: It's not enough to run the add-lib.sh files and go home. For some reason that's not yet clear, the first js animations needs to have lib tacked on at the end, and be empty in the beginning. This is a why the generic AllScenarios_LibFixer.js is included in all the scenarios, which fixes this issue.

Essentially, add-lib.sh replaces this:

#!bash

var lib={}; 

with

#!bash

var lib = window.lib || AdobeAn.getComposition(Object.keys(AdobeAn.compositions)[0]).getLibrary();

For all js animations except the above mentioned AllScenarios_LibFixer.js, this lib is replaced at the start of the file.

Scripts not working? Don't have sed? Install it

for Mac OS X, you need a package manager like homebrew so you can do:

#!bash

brew install gnu-sed

It will be installed as gsed. Then add this to .bashrc file

#!bash

PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"

If you don't have a .bashrc file, create one (it can have just that one line there). After I believe you must add these lines to your .bash_profile

#!bash

# Get the aliases and functions                                                 
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

Mark the palette.sh (and all scripts) executable if it isn't. Run ls -laht and see if it has executable permission. If not, do this for each of the sh files:

#!bash

chmod +x palette.sh

Updated