By casey
#243639
I having some trouble upgrading to the 1.5 Maxwell plug-in.

With 1.1, it was possible to automatically export an MXS file by issuing the MAXScript command,
Code: Select all
max quick render;
unfortunately it was not possible to control the name of the file, since it was set via the UI and could not be set by MAXScript (as far as I could tell).

Now, with 1.5, the opposite is true:
Code: Select all
exportFile "h:/cmaxd/job.mxs" #noPrompt;
I can set the name of the file, but even with the #noPrompt option, the file does not export automatically. Instead it produces a dialog box that requires the user to select a camera and choose whether or not they wish to export an animation range.

What I really need is a command that specifies everything in MAXScript, so that it can be properly automated without any user interaction. Maxwell's DLR could export this command directly:
Code: Select all
maxwellExportMXS outputName:"h:/cmaxd/job.mxs" camera:$SomeCamera;
Does something like this exist in the plug-in?

If not, it is extremely easy to add. Off the top of my head, you'd just add this code to your DLR:
Code: Select all
def_visible_primitive(maxwellExportMXS, "maxwellExportMXS");

Value *
maxwellExportMXS_cf(Value **ArgumentList, int ArgumentCount)
{
    Value *Result = &false_value;

    INode *CameraNode = 0;
    char *OutputName = 0;

    Value *Arg = _get_key_arg(ArgumentList, ArgumentCount, Name::intern("camera"));
    if(Arg && (Arg != &unsupplied))
    {
        CameraNode = Arg->to_node();
    }

    Arg = _get_key_arg(ArgumentList, ArgumentCount, Name::intern("outputName"));
    if(Arg && (Arg != &unsupplied))
    {
        OutputName = Arg->to_string();
    }

    if(CameraNode && OutputName)
    {
        //
        // ... actual Maxwell internal export routines get called here
        //

        Result = &true_value;
    }

    return(Result);
}
and insert a call to your actual export path in where my // is.

- Casey
By Bogdan Coroi
#243692
Code:

maxwellExportMXS outputName:"h:/cmaxd/job.mxs" camera:$SomeCamera;


Does something like this exist in the plug-in?
Unfortunately, there isn't something like this in the plugin, and also there is no way to bypass the export dialog. There will be some modification to the code to allow (batch) export without user intervention.

PS. Thanks for the code. :)
Help with swimming pool water

Hi Andreas " I would say the above "fake[…]

render engines and Maxwell

Other rendering engines are evolving day by day, m[…]