The PaletteManager JavaScript global object. Used to get information about the Colour view current selection.
More...
The PaletteManager JavaScript global object. Used to get information about the Colour view current selection.
An example of how to use the palette override attributes of the colour override node, using the PaletteManager:
Available attributes for getTextAttr:
- PALETTES.NUMBER - returns the number of palettes in the palette override list
- PALETTES.x, where x is a palette index - return the palette name (path) of the palette at index x (x >= 0)
If no x, or it's invalid, assume a value of 0
Available attributes for setTextAttr:
- PALETTES.CLEAR - clear the palette override list
- PALETTES.ADD "palette_path" - add the palette with full path name to the palette override list. Can supply the full path or get from PaletteManager.getPalettePath(), PaletteManager.getCurrentPalettePath()
- PALETTES.REMOVE "palette_path" - remove a palette. Can supply the full path or get from getTextAttr("node_path", atFrame, "PALETTES.x")
Note that the frame number argument (to node.getTextAttr() and node.setTextAttr()) is unused, and the attribute value in "PALETTES.CLEAR" is unused.
function paletteOverrideExample()
{
return;
var index = parseInt(num);
index--;
var attr = "PALETTES." + index;
}
◆ applyColorSelection
void PaletteManager::applyColorSelection |
( |
| ) |
|
|
slot |
Applies the current colour selection to the current drawing selection.
◆ getColorId
String PaletteManager::getColorId |
( |
int |
index | ) |
|
|
slot |
Gets the Id of the colour in the currently selected palette.
- Parameters
-
index | : Index of colour in palette. |
- Returns
- Returns the Id of the colour in the currently selected palette.
◆ getColorName
String PaletteManager::getColorName |
( |
int |
index | ) |
|
|
slot |
Gets the name of the colour in the currently selected palette.
- Parameters
-
index | : Index of colour in palette. |
- Returns
- Returns the name of the colour in the currently selected palette.
◆ getCurrentColorId
String PaletteManager::getCurrentColorId |
( |
| ) |
|
|
slot |
Gets the current colour Id from the ColourView.
- Returns
- Returns the current colour Id from the ColourView.
◆ getCurrentColorName
String PaletteManager::getCurrentColorName |
( |
| ) |
|
|
slot |
Gets the current colour name from the ColourView.
- Returns
- Returns the current colour name from the ColourView.
◆ getCurrentPaletteId
String PaletteManager::getCurrentPaletteId |
( |
| ) |
|
|
slot |
Gets the current palette Id from the ColourView.
- Returns
- Returns the current palette Id from the ColourView.
◆ getCurrentPaletteName
String PaletteManager::getCurrentPaletteName |
( |
| ) |
|
|
slot |
Gets the current palette name from the ColourView.
- Returns
- Returns the current palette name from the ColourView.
◆ getCurrentPalettePath
String PaletteManager::getCurrentPalettePath |
( |
| ) |
|
|
slot |
Gets the current palette path (including palette name) from the ColourView.
- Returns
- Returns the current palette path (including palette name) from the ColourView.
◆ getCurrentPaletteSize
int PaletteManager::getCurrentPaletteSize |
( |
| ) |
|
|
slot |
Gets the length of the current palette in the ColourView.
- Returns
- Returns the length of the current palette in the ColourView.
◆ getNumPalettes [1/2]
int PaletteManager::getNumPalettes |
( |
| ) |
|
|
slot |
Gets number of palettes in the currently selected palette list in the ColourView list.
- Returns
- Returns the number of palettes in the currently selected palette list in the ColourView list.
◆ getNumPalettes [2/2]
int PaletteManager::getNumPalettes |
( |
bool |
scenePaletteList | ) |
|
|
slot |
Gets number of palettes in the palette list in the ColourView.
- Parameters
-
scenePaletteList | : Whether to check scene palette list or element palette list. |
- Returns
- Returns the number of palettes in the palette list in the ColourView.
◆ getPaletteId [1/2]
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. |
- Returns
- Returns the Id of the palette in the current palette list.
◆ getPaletteId [2/2]
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. |
- Returns
- Returns the Id of the palette in the current palette list.
◆ getPaletteName [1/2]
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. |
- Returns
- Returns the name of the palette in the current palette list.
◆ getPaletteName [2/2]
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. |
- Returns
- Returns the name of the palette in the current palette list.
◆ getPalettePath [1/2]
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 |
- Returns
- Returns the path (including name) of the palette in the current palette list.
◆ getPalettePath [2/2]
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. |
- Returns
- Returns the path (including name) of the palette in the current palette list.
◆ setCurrentColorById
void PaletteManager::setCurrentColorById |
( |
String |
color | ) |
|
|
slot |
Sets the current colour in the ColourView.
- Parameters
-
◆ setCurrentPaletteAndColorById
void PaletteManager::setCurrentPaletteAndColorById |
( |
String |
palette, |
|
|
String |
color |
|
) |
| |
|
slot |
Sets the current palette and colour in the ColourView.
- Parameters
-
palette | : Palette Id. |
color | : Colour Id. |
◆ setCurrentPaletteById
void PaletteManager::setCurrentPaletteById |
( |
String |
palette | ) |
|
|
slot |
Sets the current palette in the ColourView.
- Parameters
-
◆ setCurrentPencilTextureById
void PaletteManager::setCurrentPencilTextureById |
( |
String |
texture | ) |
|
|
slot |