Go to: Synopsis. Return value. Keywords. Flags. MEL examples.

Synopsis

ghosting [-action string] [-allGhostedObjects] [-allInRange boolean] [-customFrames int] [-enable boolean] [-farOpacity float] [-frames] [-geometryFilter boolean] [-ghostedObjects] [-ghostsStep int] [-hierarchy boolean] [-jointFilter boolean] [-locatorFilter boolean] [-mode string] [-nearOpacity float] [-postColor float float float] [-postFrames int] [-preColor float float float] [-preFrames int] [-preset string] [-resetAll] [-useDriver boolean]

ghosting is undoable, queryable, and editable.

Provides an aggregated interface to all of the node-base ghosting parameters, as well as the global preferences used by this command for ghosting actions. Query the 'enable' flag to check if ghost drawing is currently enabled. If you run in create mode with no 'action' set then you will be modifying the current values of the ghosting parameters. If you have 'action=ghost' set then you will be modifying the current values of the ghosting parameters and then applying them to selected objects.

Return value

booleanthe previous global state of ghost visibility (after setting 'enable' flag)
booleanthe global state of ghost visibility (query 'enabled' flag)
booleanthe global state of the default ghost all-in-range value (query 'allInRange' flag)
booleanthe global state of the default ghost hierarchy (query 'hierarchy' flag)
booleanthe global state of the default ghost geometry filter (query 'geometryFilter' flag)
booleanthe global state of the default ghost joint filter (query 'jointFilter' flag)
booleanthe global state of the default ghost locator filter (query 'locatorFilter' flag)
booleanthe global state of the default post frame count (query 'postFrames' flag)
booleanthe global state of the default pre frame count (query 'preFrames' flag)
booleanthe global state of the default ghost frames step count (query 'ghostsStep' flag)
string[]List of all objects for which ghosting was enabled ('action="ghost"' in create mode)
string[]List of all objects for which ghosting was disabled ('action="unghost"' or 'action="unghostAll"' in create mode)
string[]List of all objects for which ghosting is currently enabled (query 'ghostedObjects' flag)
string[]List of affected objects (any flag in edit mode)
float[]List of (frame1, frame2, ...) that is the union of ghosted frames on all selected objects (query 'frames' flag)
floatCurrent opacity value for ghosts farthest from the current time (query 'farOpacity' flag)
floatCurrent opacity value for ghosts closest to the current time (query 'nearOpacity' flag)
floatThe previous opacity value for ghosts farthest from the current time (set 'farOpacity' flag)
floatThe previous opacity value for ghosts closest to the current time (set 'nearOpacity' flag)
stringCurrent ghosting mode (query 'mode' flag)
stringThe previous ghosting mode (set 'mode' flag)
float[]Color as [red, green, blue] used for ghosts after the current time (query 'postColor' flag)
float[]Previous color as [red, green, blue] used for ghosts after the current time (set 'postColor' flag)
float[]Color as [red, green, blue] used for ghosts before the current time (query 'preColor' flag)
float[]Previous color as [red, green, blue] used for ghosts before the current time (set 'preColor' flag)
int[]Custom frame list for the 'frames' mode (query 'customFrames' flag)
int[]Previous custom frame list (set 'customFrames' flag)

In query mode, return type is based on queried flag.

Keywords

OGS, ghosting

Flags

action, allGhostedObjects, allInRange, customFrames, enable, farOpacity, frames, geometryFilter, ghostedObjects, ghostsStep, hierarchy, jointFilter, locatorFilter, mode, nearOpacity, postColor, postFrames, preColor, preFrames, preset, resetAll, useDriver
Long name (short name) Argument types Properties
-action(-act) string create
Define the actions to be performed by the command. Legal values are "ghost", "unghost", and "unghostAll". The "ghost" will try to enable ghosting on all _visible_ DAG objects in the selection list. Imtermediate transform nodes will only be ghosted if axis display are active.
-allGhostedObjects(-ago) edit
Only works in edit mode, specifying that the edits are to be applied to all ghosted objects instead of just the selected ones.
-allInRange(-a) boolean createqueryedit
In create mode, define the default value for whether keyframe mode should use every keyframe in the playback range or use the specified values. In edit mode, modify the all-in-range value for all ghosts. In create mode with the "ghost" action, also set the custom ghost all-in-range value for the selected objects.
-customFrames(-cf) int createqueryeditmultiuse
In create mode, define the default value for the list of custom ghost frames. In edit mode, modify the custom ghost frames for all ghosts. The special frame number "-9999999" is used to remove all custom frames, circumventing a quirk in the command engine that does not allow passing an empty list. In create mode with the "ghost" action, also set the custom ghost frames for the selected objects.
-enable(-en) boolean createquery
Enables or disables ghost visibility on the entire scene. This does not modify any of the node ghosting attributes, it only globally enables or disables the drawing of any ghosts that have been defined on nodes. This is a preference-based flag so its value will persist between sessions, even if you load a new file with different ghost attribute settings.
-farOpacity(-fo) float createqueryedit
In create mode, define the default value for the opacity value for ghosts farthest away from the current time. In edit mode, modify the opacity value of ghosts farthest away from the current time for all ghosts. In create mode with the "ghost" action, also set the opacity value of ghosts farthest away from the current time for the selected objects.
-frames(-f) query
Queries the current set of ghost frames on the selected objects based on the ghosting mode, parameters set on the object, and the current time when relevant. Ignores the state of the ghosting enabled flag.
-geometryFilter(-gf) boolean createqueryedit
In create mode, enable or disable the default ghost geometry filter. In create mode with the "ghost" action set, also filter the selection to omit geometry nodes if this flag is false.
-ghostedObjects(-go) query
Only works in query mode to find the names of all currently ghosted DAG nodes.
-ghostsStep(-gs) int createqueryedit
In create mode, define the default value for the number of steps (keyframes or frames) between ghosts. In edit mode, modify the number of steps (keyframes or frames) between ghosts. In create mode with the "ghost" action, also set the default number of steps (keyframes or frames) between ghosts for the selected objects.
-hierarchy(-h) boolean createqueryedit
Enables or disables the ghost hierarchy default value. When no ghosting action is set it does not modify any of the node ghosting attributes, it only sets the preference for how future commands will filter the list of affected nodes. When used in conjunction with a ghosting action it will fist set the preference value and then use that new value as a filter on the ghosting action. If a ghosting action is specified without this flag then the current value of the preference is used in its place. This is a preference-based flag so its value will persist between sessions, even if you load a new file with different ghost attribute settings.
-jointFilter(-jf) boolean createqueryedit
In create mode, enable or disable the default ghost joint filter. In create mode with the "ghost" action set, also filter the selection to omit joint nodes if this flag is false.
-locatorFilter(-lf) boolean createqueryedit
In create mode, enable or disable the default ghost locator filter. In create mode with the "ghost" action set, also filter the selection to omit locator nodes if this flag is false.
-mode(-m) string createqueryedit
Define the default mode for ghosting actions. Legal values are "preAndPost", "pre", "post", "custom", and "keyframes".
-nearOpacity(-no) float createqueryedit
In create mode, define the default value for the opacity value for ghosts nearest to the current time. In edit mode, modify the opacity value of ghosts nearest to the current time for all ghosts. In create mode with the "ghost" action, also set the opacity value of ghosts nearest to the current time for the selected objects.
-postColor(-poc) float float float createqueryedit
In create mode, define the default value for the color of ghosts after the current time. In edit mode, modify the color of ghosts after the current time for all ghosts. In create mode with the "ghost" action, also set the color of ghosts after the current time for the selected objects.
-postFrames(-pof) int createqueryedit
In create mode, define the default value for the number of ghosted frames after the current time. In edit mode, modify the number of ghosted frames after the current time for all ghosts. In create mode with the "ghost" action, also set the default number of ghosted frames after the current time for the selected objects.
-preColor(-prc) float float float createqueryedit
In create mode, define the default value for the color of ghosts before the current time. In edit mode, modify the color of ghosts before the current time for all ghosts. In create mode with the "ghost" action, also set the color of ghosts before the current time for the selected objects.
-preFrames(-prf) int createqueryedit
In create mode, define the default value for the number of ghosted frames before the current time. In edit mode, modify the number of ghosted frames before the current time for all ghosts. In create mode with the "ghost" action, also set the default number of ghosted frames before the current time for the selected objects.
-preset(-p) string createqueryedit
Define the default mode for ghosting presets. Legal values are "1s", "2s", "4s", "5s", "10s", and "Custom". Setting anything other than "Custom" fixes ghosts at 3 pre frames, 3 post frames, with a step value of the preset (e.g. "2s" means show ghosts at every second frame or keyframe)
-resetAll(-r) createedit
Reset all ghosting options to their default values. Use with caution!
-useDriver(-ud) boolean createqueryedit
In create mode, enable or disable the default ghost use driver value. In edit mode, modify the use driver value of all existing ghosts. In create mode with the "ghost" action, also set the use driver value for the selected objects.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples


// Turn off all ghost drawing
ghosting -enable off;

// Change the default actions to prevent walking down the DAG hierarchies when finding objects to ghost/unghost
ghosting -hierarchy off;

// Ghost the selected objects
ghosting -act ghost;
// Result: OBJECT1 //

// Unghost the selected objects
ghosting -act unghost;
// Result: OBJECT1 //

// Unghost all objects
ghosting -act unghostAll;
// Result: OBJECT1 //

// Set the mode to use only keyframes as specified, rather than every one in the playback range for ghosts
ghosting -mode "keyframes";
ghosting -allInRange 0;

// Set three custom ghost frames
ghosting -mode "custom";
ghosting -customFrames 1 2 50;

// Set the opacity of the ghost farthest from the current frame
ghosting -farOpacity 0.01;

// Query the current list of ghost frames using the ghost parameters on OBJECT1
ghosting -query -frames OBJECT1;
// Return: 1.0 2.0 50.0 //

// Make future ghosting actions skip geometry objects (e.g. meshes)
ghosting -geometryFilter on;

// Get the list of currently ghosted objects
ghosting -query -ghostedObjects;
// Return: OBJECT1 //

// Change the number of ghosted frames after the current time to 2
ghosting -postFrames 2;

// Change the number of ghosted frames before the current time to 5
ghosting -preFrames 5;

// Change the step between ghosts to be 2
ghosting -ghostsStep 2;

// Make future ghosting actions skip joints
ghosting -jointFilter on;

// Make future ghosting actions skip locators
ghosting -locatorFilter on;

// Change the ghosting mode to only have ghosts before the current frame
ghosting -mode "pre";

// Set the opacity of the ghost closest to the current frame
ghosting -nearOpacity 0.1;

// Set the color of ghosts after the current time to be green
ghosting -postColor 0.0 1.0 0.0;

// Set the color of ghosts before the current frame to red and modify all existing ghosts to use that color
ghosting -edit -allGhostedObjects -preColor 1.0 0.0 0.0;
// Return: OBJECT1 //

// Set the preset to show every other ghost
ghosting -preset "2s";

// Set the preset to show 5 pre frames, 2 post frames, at every 5th frame
ghosting -preset "Custom";
ghosting -preFrames 5;
ghosting -postFrames 2;
ghosting -ghostsStep 5;
ghosting -mode "preAndPost";

// Reset all ghosting parameters to their default values
ghosting -resetAll;
// Return: 1 //

// Set the use-driver default for the ghosts
ghosting -useDriver 1;