Script
Public Slots | List of all members
PaletteManager Class Reference

query information from the Colour view More...

#include <colorUI.h>

Inheritance diagram for PaletteManager:
Inheritance graph
[legend]
Collaboration diagram for PaletteManager:
Collaboration graph
[legend]

Public Slots

String getCurrentColorId ()
 Gets the current color Id from the ColourView. More...
 
String getCurrentColorName ()
 Gets the current color name from the ColourView. More...
 
String getCurrentPaletteId ()
 Gets the current palette id from the ColourView. More...
 
String getCurrentPaletteName ()
 Gets the current palette name from the ColourView. More...
 
String getCurrentPalettePath ()
 Gets the current palette path (including palette name) from the ColourView. More...
 
void setCurrentPaletteById (String palette)
 Sets the current palette in the ColourView. More...
 
void setCurrentColorById (String color)
 Sets the current color in the ColourView. More...
 
void setCurrentPaletteAndColorById (String palette, String color)
 Sets the current palette and colour in the ColourView. More...
 
int getCurrentPaletteSize ()
 gets the length of the current palette in the ColourView More...
 
String getColorName (int index)
 Gets the name of the the colour in the currently selected palette. More...
 
String getColorId (int index)
 Gets the id of the the colour in the currently selected palette. More...
 
int getNumPalettes ()
 Gets number of palettes in the current selected palette list in ColourView list. More...
 
int getNumPalettes (bool scenePaletteList)
 Gets number of palettes in palette list in ColourView. More...
 
String getPaletteName (int index)
 Gets the name of the palette in the current palette list. More...
 
String getPaletteName (int index, bool scenePaletteList)
 Gets the name of the palette in the current palette list. More...
 
String getPalettePath (int index)
 Gets the path (including name) of the palette in the current palette list. More...
 
String getPalettePath (int index, bool scenePaletteList)
 Gets the path (including name) of the palette in the current palette list. More...
 
String getPaletteId (int index)
 Gets the id of the palette in the current palette list. More...
 
String getPaletteId (int index, bool scenePaletteList)
 Gets the id of the palette in the current palette list. More...
 

Detailed Description

query information from the Colour view

An example of how to use the palette override attributes of the colour override module, using the PaletteManager:

Available attributes for getTextAttr:

function paletteOverrideExample()
{
return;
// not strictly necessary, depends on whether each setTextAttr() call should be undoable individually
scene.beginUndoRedoAccum("Palette Overrides");
var module = selection.selectedNode(0);
// return the number of palettes in the palette override list
var num = node.getTextAttr(module, 1, "PALETTES.NUMBER");
// return the first (top-most) palette name in the palette override list (will be "" if the list is empty).
// note that no palette number is supplied in this example, so 0 is assumed (equivalent to "PALETTES.0")
var palette = node.getTextAttr(module, 1, "PALETTES");
// clear (empty) the list
node.setTextAttr(module, "PALETTES.CLEAR", 1, "");
// should be 0
num = node.getTextAttr(module, 1, "PALETTES.NUMBER");
// add a palette to the palette override list
node.setTextAttr(module, "PALETTES.ADD", 1, curpath);
// can also specify a full path for the palette
//node.setTextAttr(module, "PALETTES.ADD", 1, "/usadata000/.../example.plt");
// this should do nothing, already exists
//node.setTextAttr(module, "PALETTES.ADD", 1, "/usadata000/.../example.plt");
// return the first two palette names (we added one, so one should be non-empty)
palette = node.getTextAttr(module, 1, "PALETTES.0");
// this one should be "", only one in the list
var palette1 = node.getTextAttr(module, 1, "PALETTES.1");
// return the name of the last palette that we added
num = node.getTextAttr(module, 1, "PALETTES.NUMBER");
var index = parseInt(num);
index--;
var attr = "PALETTES." + index;
palette = node.getTextAttr(module, 1, attr);
// remove one from the list
node.setTextAttr(module, "PALETTES.REMOVE", 1, palette);
num = node.getTextAttr(module, 1, "PALETTES.NUMBER");
}

Member Function Documentation

String PaletteManager::getColorId ( int  index)
slot

Gets the id of the the colour in the currently selected palette.

Parameters
index- index of colour in palette
String PaletteManager::getColorName ( int  index)
slot

Gets the name of the the colour in the currently selected palette.

Parameters
index- index of colour in palette
String PaletteManager::getCurrentColorId ( )
slot

Gets the current color Id from the ColourView.

String PaletteManager::getCurrentColorName ( )
slot

Gets the current color name from the ColourView.

String PaletteManager::getCurrentPaletteId ( )
slot

Gets the current palette id from the ColourView.

String PaletteManager::getCurrentPaletteName ( )
slot

Gets the current palette name from the ColourView.

String PaletteManager::getCurrentPalettePath ( )
slot

Gets the current palette path (including palette name) from the ColourView.

int PaletteManager::getCurrentPaletteSize ( )
slot

gets the length of the current palette in the ColourView

int PaletteManager::getNumPalettes ( )
slot

Gets number of palettes in the current selected palette list in ColourView list.

Parameters
useruser data
int PaletteManager::getNumPalettes ( bool  scenePaletteList)
slot

Gets number of palettes in palette list in ColourView.

Parameters
scenePaletteList- whether to check scene palette list or element palette list
String PaletteManager::getPaletteId ( int  index)
slot

Gets the id of the palette in the current palette list.

Parameters
index- index of palette within palette list
String PaletteManager::getPaletteId ( int  index,
bool  scenePaletteList 
)
slot

Gets the id of the palette in the current palette list.

Parameters
index- index of palette within palette list
scenePaletteList- whether to check scene palette list or element palette list
String PaletteManager::getPaletteName ( int  index)
slot

Gets the name of the palette in the current palette list.

Parameters
index- index of palette within palette list
String PaletteManager::getPaletteName ( int  index,
bool  scenePaletteList 
)
slot

Gets the name of the palette in the current palette list.

Parameters
index- index of palette within palette list
scenePaletteList- whether to check scene palette list or element palette list
String PaletteManager::getPalettePath ( int  index)
slot

Gets the path (including name) of the palette in the current palette list.

Parameters
index- index of palette within palette list
String PaletteManager::getPalettePath ( int  index,
bool  scenePaletteList 
)
slot

Gets the path (including name) of the palette in the current palette list.

Parameters
index- index of palette within palette list
scenePaletteList- whether to check scene palette list or element palette list
void PaletteManager::setCurrentColorById ( String  color)
slot

Sets the current color in the ColourView.

Parameters
color- id of colour
void PaletteManager::setCurrentPaletteAndColorById ( String  palette,
String  color 
)
slot

Sets the current palette and colour in the ColourView.

Parameters
palette- palette id
color- color id
void PaletteManager::setCurrentPaletteById ( String  palette)
slot

Sets the current palette in the ColourView.

Parameters
palette- id of palette

The documentation for this class was generated from the following file: