Originally posted by wildeyedboyfromfreecloud:
[b]don’t worry about it.
yeah i’m halfway familiar with chunks. that is the format the 3ds files are in… so kinda put the maya project on the back burner for the meantime. i got a little stuck. i loaded my exporter in and i was trying to get it to work like OBJexport. whereas you click on export in the file dropdown.
i modified this mel script file that the objexport plugin referenced that created the GUI. but i couldn’t get my pulgin to link with it. i’m not sure if maya builds it automatically for all file translator plugins. or well the whole project just got anoying and i was burning to much time on it. here is the GUI building mel file. it doesn’t work if i just pop it in the command prompt the way i want it to. i’m trying not to sound too juvenile. but boy is this a headache. all i did initially is modify the objexporter to export the necesary data for volumetric shadowing. here is the mel cript.
// RCSfile: objExportOptions.mel Revision: /main/1
global proc int AvalonExportOptions ( string $parent,
string $action,
string $initialSettings,
string $resultCallback )
//
// Description:
// This script posts the OBJ file translator options.
// The optionsString is of the form:
// varName1=value1;varName2=value2;…
//
// Parameters:
// $parent - the elf parent layout for this options layout. It is
// always a scrollLayout.
// $action - the action that is to be performed with this invokation
// of this proc. Valid options are:
// “query” - construct the options string and pass it
// to the resultCallback.
// “post” - post all the elf controls.
// $initialSettings - the current options string in effect at the
// time this script is invoked.
// $resultCallback -
// This is the proc to be called with the result string.
// resultCallback ( string $optionsString )
//
// Returns:
// 1 if successfull.
// 0 otherwise.
//
{
int $bResult;
string $currentOptions;
string $optionList;
string $optionBreakDown;
int $index;
if ($action == “post”) {
setParent $parent;
columnLayout -adj true objTypeCol;
radioButtonGrp
-l "Groups"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objGroups;
radioButtonGrp
-l "Point groups"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objPtGroups;
radioButtonGrp
-l "Materials"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objMaterials;
radioButtonGrp
-l "Smoothing"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objSmoothing;
radioButtonGrp
-l "Normals"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objNormals;
radioButtonGrp
-l "Shadows"
-nrb 2 -cw3 175 75 75
-la2 "On" "Off" objShadows;
// Now set to current settings.
$currentOptions = $initialSettings;
if (size($currentOptions) > 0) {
tokenize($currentOptions, ";", $optionList);
for ($index = 0; $index < size($optionList); $index++) {
tokenize($optionList[$index], "=", $optionBreakDown);
if ($optionBreakDown[0] == "groups") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objGroups;
} else {
radioButtonGrp -e -sl 1 objGroups;
}
} else if ($optionBreakDown[0] == "ptgroups") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objPtGroups;
} else {
radioButtonGrp -e -sl 1 objPtGroups;
}
} else if ($optionBreakDown[0] == "materials") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objMaterials;
} else {
radioButtonGrp -e -sl 1 objMaterials;
}
} else if ($optionBreakDown[0] == "smoothing") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objSmoothing;
} else {
radioButtonGrp -e -sl 1 objSmoothing;
}
} else if ($optionBreakDown[0] == "normals") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objNormals;
} else {
radioButtonGrp -e -sl 1 objNormals;
}
} else if ($optionBreakDown[0] == "shadows") {
if ($optionBreakDown[1] == "0") {
radioButtonGrp -e -sl 2 objShadows;
} else {
radioButtonGrp -e -sl 1 objShadows;
}
}
}
}
$result = 1;
} else if ($action == “query”) {
if (`radioButtonGrp -q -sl objGroups` == 1) {
$currentOptions = $currentOptions + "groups=1";
} else {
$currentOptions = $currentOptions + "groups=0";
}
if (`radioButtonGrp -q -sl objPtGroups` == 1) {
$currentOptions = $currentOptions + ";ptgroups=1";
} else {
$currentOptions = $currentOptions + ";ptgroups=0";
}
if (`radioButtonGrp -q -sl objMaterials` == 1) {
$currentOptions = $currentOptions + ";materials=1";
} else {
$currentOptions = $currentOptions + ";materials=0";
}
if (`radioButtonGrp -q -sl objSmoothing` == 1) {
$currentOptions = $currentOptions + ";smoothing=1";
} else {
$currentOptions = $currentOptions + ";smoothing=0";
}
if (`radioButtonGrp -q -sl objNormals` == 1) {
$currentOptions = $currentOptions + ";normals=1";
} else {
$currentOptions = $currentOptions + ";normals=0";
}
if (`radioButtonGrp -q -sl objShadows` == 1) {
$currentOptions = $currentOptions + ";shadows=1";
} else {
$currentOptions = $currentOptions + ";shadows=0";
}
eval($resultCallback+" \""+$currentOptions+"\"");
$result = 1;
} else {
$bResult = 0;
}
return $bResult;
}
sorry bout the drag. the translator is loaded in so i can go to export and choose it as an export type. but then i get this error in the maya status report bar
rror: Cannot link to “AvalonExportOptions”. Check number and types of arguments expected on procedure definition.
i apreciate the help but don’t let yourself get stressed out over me. its not worth it i’m sure. thanks
michale
[This message has been edited by wildeyedboyfromfreecloud (edited 02-27-2002).][/b]
When you resister the file translator in the plugin you specify the script name for the export option GUI, ie,
const char *const objOptionScript = “objExportOptions”;
const char *const objDefaultOptions =
“groups=1;”
“ptgroups=1;”
“materials=1;”
“smoothing=1;”
“normals=1;”
;
MStatus initializePlugin( MObject obj )
{
MFnPlugin plugin( obj, “Alias|Wavefront”, “3.0”, “Any”);
// Register the translator with the system
return plugin.registerFileTranslator( "OBJexport", "none",
ObjTranslator::creator,
(char *)objOptionScript,
(char *)objDefaultOptions );
}
the script name “objExportOptions” must contain a global proc with exactly the same name for maya to run the script, in this case “objExportOptions”. By the looks of your script it should work, I’m guessing that the problem must be that it isn’t in one of the script directorys.
Try putting it in the
"my documents\maya\4.0\scripts"
directory. Maya should automatically source it from there. The only actions it should perform are the “post” action where it creates the user interface using the optionString to determine what the settings should be for the controls, and “query” where you construct a string that is passed into your writer function of the plugin which you can then split up to determine the options set by the user.
Just ask if there’s anything else you need help on.
Rob.