Vexus Plugin \ MAX Script Reference

Vexus Plugin

Previous Next

 

Overview

The following methods can be used to get or set properties for Vexus.

 

It's important to make mention that all indexes are 0 based index. This is critical when looping through nodes of a Vexus graph.

 

Methods


<integer>Version()

Returns the plugin version as an integer. For example, a return value of 100 would mean version 1.00

 

 

<boolean>CheckVersion()

Displays information to the user regarding the current version in relation to the most recent version.  Returns true if the most recent version is running, returns false if an update is available.

 

 

<integer>GetVerbose()

Returns the verbosity setting for Vexus

 

 

<void>SetVerbose <integer>Verbose

Set the verbose level to Off, On or Debug (if applicable) using values 0, 1 or 2 respectively. Integer range is 0 - 2

 

 

<boolean>Edit()

Launches the Vexus node editor

 

 

<boolean>View()

Launches the Vexus graph viewer (native to the 3ds MAX plugin)

 

 

<boolean>Load <string>Filename

Loads a Vexus file into the graph

 

 

<boolean>ExecuteGraph <integer>Index <string>XML_String

This will load an xml string and execute the node indicated by index

 

 

<boolean>ExecuteGraphFile <integer>Index <string>Filename

This will load a vexus file and execute the node indicated by index

 

 

<boolean>ExecuteNode <integer>Index

If a graph is already loaded, executes the node indicated by Index

 

 

<integer>Status()

Returns 0 if Vexus is running correctly, non-Zero otherwise.)

 

 

<boolean>Start()

Tells Vexus to start listening (if it isn't already)

 

 

<boolean>Stop()

Tells Vexus to stop listening

 

 

<integer>GetListenPort()

Returns the port that Vexus is listening on

 

 

<boolean>SetListenPort <integer>Port

Sets the port that Vexus will listening on

 

 

<integer>GetSendPort()

Returns the port that Vexus is sending on

 

 

<boolean>SetSendPort <integer>Port

Sets the port that Vexus will be sending on

 

 

<integer>NumberOfPassNodes()

Returns the number of pass nodes in the graph

 

 

<integer>GetPassNodeID <integer>Pass

Returns the node ID for the specified Pass ID

 

 

<string>GetNameByNodeID <integer>NodeID

Returns the name of the Node in the Vexus graph by Index

 

 

<boolean>IsDemo()

Returns true if the Demo version of the plugin is operating, false otherwise

 

 

<boolean>Authorize()

Brings up the plugin authorization interface

 

 

<boolean>About()

Brings up the Vexus plugin About dialog

 

 

<boolean>IsAuthorized()

Returns true if the plugin is authorized, false otherwise

 

 

<integer>NumberOfShotNodes()

Returns the number of shot nodes in the graph

 

 

<integer>GetShotNodeID <integer>Shot

Returns the shot ID for the specified shot ID

 

 

<integer>GetNumberofShotPasses <integer>Shot

Returns the number of child pass nodes for the specified shot node.

 

 

<boolean>ExecuteShotByIndex <integer>Shot <integer>Pass

If a graph is already loaded, executes the shot node indicated by index in the shot list, executing child pass by it's index in the shot's list of passes.

 

 

<boolean>ExecuteShotByID <integer>Shot <integer>Pass

If a graph is already loaded, executes the shot node indicated by it's node id, executing child pass by it's node id.

 

 

<integer>GetShotPassNodeID <integer>Shot <integer>Pass

Returns the ID for the specified child pass node of the supplied shot node index.

 

 

<boolean>IsNodeEnabled <integer>NodeID 

Returns True if the node is Enabled and False if the node is disabled for the specified graph node, based on it's ID.

 

 

<boolean>GetRedrawViews()

Returns true is Redraw Viewport is enabled in the Vexus interface.

 

 

<boolean>SetRedrawViews <boolean>Redraw 

Sets the option to permit/suspend the redrawing of viewports.

 

 

<boolean>SubmitGraphFile <string>Filename <string>SubmitScript 

Submits a Vexus Graph File for evaluation.

 

 

<boolean>Echo <string>String 

Sends a text string to the status bar of whichever instance of the Vexus Node editor is currently listening.

 

 

<int>AtrributeCount() 

Indicates the number of attributes that in the currently executed CustomMXS node.  Should only be called while evaluating a Custom MXS node.

 

 

<string>AttributeKey <integer>Index

Returns the attribute key for a given index. Should only be called while evaluating a Custom MXS node.

 

 

<string>AttributeValue <integer>Index

Returns the attribute value for a given index. Should only be called while evaluating a Custom MXS node.

 

 

<texturemap>FindTexmap <string>texmap 

Returns the texture map that matches the provided string (used internally).

 

 

<material>FindMaterial <string>mat

Returns the material that matches the provided string (used internally).

 

 

<void>ResetFinders()

Reset the Material/Texmap finder structure (used internally).

 

 

<string>GetToken <string>Key 

Returns value of Vexus assigned token. Returns "undefined" if the token doesn't exist.

 

 

<boolean>SetToken <string>Key <string>Value 

Sets a token value, overwriting the prior value (if present).  Returns true if successful.

 

 

<int>GetNumTokens() 

Returns the number of known tokens in the Vexus token table.

 

 

<string>GetTokenByIndex <integer>Index

Returns the token value as indexed in the Vexus token table. Entries are 0 indexed.

 

 

<boolean>DoesTokenExist <string>Key

Returns true if the supplied token exists in the Vexus token table.

 

 

Properties


.PreScriptSuccess: boolean

Indicates if the last executed Pre-Submission script was successful

 

.PostScriptSuccess: boolean

Indicates if the last executed Post-Submission script was successful

 

.Camera: string

The currently selected camera in Vexus

 

.Shot: string

The current Shot that is being evaluated

 

.Pass: string

The current Pass that is being evaluated

 

.Iteration: string

The current Iteration that is being evaluated

 

.FileVersion: string

The version number extracted from the current 3ds MAX file - indicated by the last set of digits in the filename.

 

.Missing Cameras: string

Returns a comma delimited list of cameras that were referenced in the submission script but missing in the scene.

 

.SubmissionCameras: string

Returns a comma delimited list of the camera names that will be used during submission.  Useful for camera validation in preSubmission script.  This property is only valid during the submission process and returns <null> otherwise.

 

Example

The below example demonstrates how to load a Vexus file and execute each shot and it's children passes, skipping over any shots or passes that are disabled in the graph.

fn submit_vexus_file filepath =

(

          if not doesFileExist filepath do

          (

                    format "Proces canceled. Missing file: %\n" filepath

                    return False

          )

 

          /* Load Graph File Into Memeory */

          Vexus.Load filepath

          

          /* Loop through all each Shot's child Passes */

          local num_shots = Vexus.NumberOfShotNodes()

          for sIndex = 0 to num_shots-1 do

          (

                    local shot_id = Vexus.GetShotNodeID sIndex

                    local node_name = Vexus.GetNameByNodeID shot_id

                    local shot_enabled = Vexus.IsNodeEnabled shot_id

                    format "Shot: % | Enabled: %\n" node_name shot_enabled

 

                    local num_passes = Vexus.GetNumberofShotPasses sIndex

                    for pIndex = 0 to num_passes-1 do

                    (

                              local pass_id = Vexus.GetShotPassNodeID sIndex pIndex

                              local node_name = Vexus.GetNameByNodeID pass_id

                              local pass_enabled = Vexus.IsNodeEnabled pass_id

                              format "\tPass: % | Enabled: %\n" node_name pass_enabled

                              

                              /* Execute Shot > Pass */

                              if shot_enabled and pass_enabled do

                              (

                                        format "\t\tExecuting: % > Pass: %\n" node_name node_name

                                        Vexus.ExecuteShotByID shot_id pass_id

                              )

                    )

          )

          return True

)

 

clearlistener()

vx_filepath = @"C:\Users\Martini\Desktop\test_scene\store_example.vx"

submit_vexus_file vx_filepath

 

 

 


 

Copyright © 2019 Boomer Labs and JokerMartini

http://boomerlabs.com/vexus