|
TEMERITY | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectus.temerity.pipeline.Named
us.temerity.pipeline.PluginID
us.temerity.pipeline.BasePlugin
us.temerity.pipeline.BaseAction
us.temerity.pipeline.plugin.CommonActionUtils
us.temerity.pipeline.plugin.PythonActionUtils
us.temerity.pipeline.plugin.MayaActionUtils
public class MayaActionUtils
Superclass of Action plugins which interact with Maya scenes.
This class provides convenience methods which make it easier to write Action plugins which create dynamic MEL scripts and Maya scenes.
| Field Summary | |
|---|---|
static String |
aAngularUnits
|
static String |
aAnimMEL
|
static String |
aFinalMEL
|
static String |
aInitialMEL
|
static String |
aLinearUnits
|
static String |
aMayaScene
|
static String |
aModelMEL
|
static String |
aTimeUnits
|
| Fields inherited from class us.temerity.pipeline.plugin.CommonActionUtils |
|---|
aExtraOptions |
| Fields inherited from class us.temerity.pipeline.BasePlugin |
|---|
pDescription |
| Fields inherited from class us.temerity.pipeline.PluginID |
|---|
pVendor, pVersionID |
| Fields inherited from class us.temerity.pipeline.Named |
|---|
pName |
| Constructor Summary | |
|---|---|
protected |
MayaActionUtils(String name,
VersionID vid,
String vendor,
String desc)
Construct with the given name, version, vendor and description. |
| Method Summary | |
|---|---|
protected void |
addAnimMELParam()
Adds an Anim MEL parameter to the action. |
protected void |
addFinalMELParam()
Adds an Final MEL parameter to the action. |
protected void |
addInitalMELParam()
Adds an Initial MEL parameter to the action. |
protected void |
addMayaSceneParam()
Adds an Maya Scene parameter to the action. |
protected void |
addModelMELParam()
Adds an Model MEL parameter to the action. |
protected void |
addUnitsParams()
Adds Maya units parameters to the action. |
protected void |
addUnitsParamsToLayout(LayoutGroup layout)
Add the parameters created by the addUnitsParams method to the
given parameter layout group. |
static String |
createMayaCommand(Path scene,
File script)
A convienence method for creating a command-line string equivalent of createMayaSubProcess suitable for inclusion in an
executable script. |
static String |
createMayaPythonLauncher(Path scene,
File script)
A convienence method for creating the Python code equivalent of createMayaSubProcess suitable for inclusion in an
temporary Python script. |
static String |
createMayaPythonLauncher(Path scene,
Path script)
A convienence method for creating the Python code equivalent of createMayaSubProcess suitable for inclusion in an
temporary Python script. |
SubProcessHeavy |
createMayaSubProcess(Path scene,
File script,
boolean customShaders,
ActionAgenda agenda,
File outFile,
File errFile)
A convienence method for creating the SubProcessHeavy instance to be returned
by the prep method for Maya scene manipulation
Actions. |
protected String |
genUnitsMEL()
Generate a MEL snippet which specifies the Linear, Angular and Time units for the Maya scene based on the parameters created by the addUnitsParams
method. |
Path |
getMayaSceneSourcePath(String pname,
ActionAgenda agenda)
Get the abstract path to the single primary Maya scene file associated with a source node specified by the given parameter. |
Path |
getMayaSceneTargetPath(ActionAgenda agenda)
Get the abstract path to the single primary Maya scene associated with the target node. |
String |
getMayaSceneType(ActionAgenda agenda)
Get the MEL string representation of the file type of the primary Maya scene associated with the target node. |
Path |
getMelScriptSourcePath(String pname,
ActionAgenda agenda)
Get the abstract path to the single primary MEL script associated with a source node specified by the given parameter. |
protected String |
getMelSnippet(ActionAgenda agenda,
String param)
Extracts a MEL script from a file and returns it as a String. |
static Map<String,String> |
getMiCustomShaderEnv(ActionAgenda agenda)
Get the Toolset environment modified to include a custom mental ray shader path. |
static Map<String,String> |
getMiCustomShaderEnv(NodeID nodeID,
Map<String,String> env)
Get the Toolset environment modified to include a custom mental ray shader path. |
protected void |
writeAnimMEL(ActionAgenda agenda,
FileWriter out)
Generates a mel snippet that source the anim MEL script. |
protected void |
writeFinalMEL(ActionAgenda agenda,
FileWriter out)
Generates a mel snippet that source the final MEL script. |
protected void |
writeInitialMEL(ActionAgenda agenda,
FileWriter out)
Generates a mel snippet that source the initial MEL script. |
protected void |
writeModelMEL(ActionAgenda agenda,
FileWriter out)
Generates a mel snippet that source the model MEL script. |
| Methods inherited from class us.temerity.pipeline.plugin.PythonActionUtils |
|---|
createPythonSubProcess, createPythonSubProcess, createPythonSubProcess, getPythonFileVerify, getPythonFileVerify, getPythonFileVerify, getPythonFileVerify, getPythonFileVerify, getPythonFileVerify, getPythonIndent, getPythonLaunchHeader, getPythonLaunchPipeHeader, getPythonProgram, getPythonProgram |
| Methods inherited from class us.temerity.pipeline.BasePlugin |
|---|
addSupport, compareTo, getDescription, getFullMessage, getPluginID, getResource, getResources, getResourceSize, getSupports, isUnderDevelopment, removeSupport, setSupports, supports, toString, underDevelopment |
| Methods inherited from class us.temerity.pipeline.PluginID |
|---|
getVendor, getVersionID |
| Methods inherited from class us.temerity.pipeline.Named |
|---|
getName |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String aLinearUnits
public static final String aAngularUnits
public static final String aTimeUnits
public static final String aInitialMEL
public static final String aModelMEL
public static final String aAnimMEL
public static final String aFinalMEL
public static final String aMayaScene
| Constructor Detail |
|---|
protected MayaActionUtils(String name,
VersionID vid,
String vendor,
String desc)
name - The short name of the action.vid - The action plugin revision number.vendor - The name of the plugin vendor.desc - A short description of the action.| Method Detail |
|---|
protected void addMayaSceneParam()
The following single valued parameters are added:
This method should be called in the subclass constructor before specifying parameter layouts.
protected void addInitalMELParam()
The following single valued parameters are added:
This method should be called in the subclass constructor before specifying parameter layouts.
protected void addModelMELParam()
The following single valued parameters are added:
This method should be called in the subclass constructor before specifying parameter layouts.
protected void addAnimMELParam()
The following single valued parameters are added:
This method should be called in the subclass constructor before specifying parameter layouts.
protected void addFinalMELParam()
The following single valued parameters are added:
This method should be called in the subclass constructor before specifying parameter layouts.
protected void writeInitialMEL(ActionAgenda agenda,
FileWriter out)
throws PipelineException,
IOException
PipelineException
IOException
protected void writeModelMEL(ActionAgenda agenda,
FileWriter out)
throws PipelineException,
IOException
PipelineException
IOException
protected void writeAnimMEL(ActionAgenda agenda,
FileWriter out)
throws PipelineException,
IOException
PipelineException
IOException
protected void writeFinalMEL(ActionAgenda agenda,
FileWriter out)
throws PipelineException,
IOException
PipelineException
IOException
protected String getMelSnippet(ActionAgenda agenda,
String param)
throws PipelineException,
IOException
Useful for including actual MEL code in a generated script rather than sourcing it. Use
when the MEL code needs to have access to the same local variables as the script that is
calling it. See its use in MayaExportAction for an example.
agenda - The action's agenda.param - The name of the link parameter that the mel script it hooked up to.
null if the parameter does not have a
value
IOException - If there is trouble opening or reading the MEL file.
PipelineExceptionprotected void addUnitsParams()
The following single valued parameters are added:
This method should be called in the subclass constructor before specifying parameter layouts.
protected void addUnitsParamsToLayout(LayoutGroup layout)
addUnitsParams method to the
given parameter layout group.
protected String genUnitsMEL()
throws PipelineException
addUnitsParams
method.
PipelineException
public String getMayaSceneType(ActionAgenda agenda)
throws PipelineException
The value returned by this method is suitable for use with the "-type" option of the MEL "file" command.
agenda - The agenda to be accomplished by the action.
PipelineException
public Path getMayaSceneTargetPath(ActionAgenda agenda)
throws PipelineException
agenda - The agenda to be accomplished by the action.
PipelineException
public Path getMelScriptSourcePath(String pname,
ActionAgenda agenda)
throws PipelineException
pname - The name of the single valued MEL parameter.agenda - The agenda to be accomplished by the action.
null if none was specified.
PipelineException
public Path getMayaSceneSourcePath(String pname,
ActionAgenda agenda)
throws PipelineException
pname - The name of the single valued Maya scene parameter.agenda - The agenda to be accomplished by the action.
null if none was specified.
PipelineException
public static String createMayaPythonLauncher(Path scene,
File script)
createMayaSubProcess suitable for inclusion in an
temporary Python script.The returned OS level process will run Maya in batch mode to optionally load a input Maya scene and then perform some operations specified by a dynamically creatd MEL script.
The Python code generated by this method requires the "launch" method defined by PythngActionUtils.getPythonLaunchHeader. You
must first include the code generate by getPythonLaunchHeader before the
code generated by this method.
scene - The abstract path to the Maya scene to load or null to ignore.script - The temporary MEL script file to execute.
public static String createMayaPythonLauncher(Path scene,
Path script)
createMayaSubProcess suitable for inclusion in an
temporary Python script.The returned OS level process will run Maya in batch mode to optionally load a input Maya scene and then perform some operations specified by a dynamically creatd MEL script.
The Python code generated by this method requires the "launch" method defined by PythonActionUtils.getPythonLaunchHeader. You
must first include the code generate by getPythonLaunchHeaderget before
the code generated by this method.
scene - The abstract path to the Maya scene to load or null to ignore.script - The temporary MEL script file to execute.
public static Map<String,String> getMiCustomShaderEnv(ActionAgenda agenda)
throws PipelineException
If the variable PIPELINE_MI_SHADER_PATH is set in the Toolset environment, then the variable MI_CUSTOM_SHADER_PATH will be added to the environment who's value is the constructed by appending the value of PIPELINE_MI_SHADER_PATH to the working area directory containing the target node's files.
agenda - The agenda to be accomplished by the Action.
PipelineException
public static Map<String,String> getMiCustomShaderEnv(NodeID nodeID,
Map<String,String> env)
If the variable PIPELINE_MI_SHADER_PATH is set in the Toolset environment, then the variable MI_CUSTOM_SHADER_PATH will be added to the environment who's value is the constructed by appending the value of PIPELINE_MI_SHADER_PATH to the working area directory containing the target node's files.
nodeID - The unique working version identifier of the target node.env - The original Toolset environment.
public SubProcessHeavy createMayaSubProcess(Path scene,
File script,
boolean customShaders,
ActionAgenda agenda,
File outFile,
File errFile)
throws PipelineException
SubProcessHeavy instance to be returned
by the prep method for Maya scene manipulation
Actions.The returned OS level process will run Maya in batch mode to optionally load a input Maya scene and then perform some operations specified by a dynamically creatd MEL script.
If the customShaders parameter is set to true and the variable
PIPELINE_MI_SHADER_PATH is set in the Toolset environment, then the variable
MI_CUSTOM_SHADER_PATH will be added to the environment who's value is the constructed
by appending the value of PIPELINE_MI_SHADER_PATH to the working area directory
containing the target node's files.
scene - The abstract path to the Maya scene to load or null to ignore.script - The temporary MEL script file to execute.customShaders - Whether to set the value of MI_CUSTOM_SHADER_PATH (see above).agenda - The agenda to be accomplished by the Action.outFile - The file to which all STDOUT output is redirected.errFile - The file to which all STDERR output is redirected.
PipelineException
public static String createMayaCommand(Path scene,
File script)
createMayaSubProcess suitable for inclusion in an
executable script.The returned OS level process will run Maya in batch mode to optionally load a input Maya scene and then perform some operations specified by a dynamically created MEL script.
scene - The abstract path to the Maya scene to load or null to ignore.script - The temporary MEL script file to execute.
|
TEMERITY | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||