The FranticParticleRenderMXS Struct

Available in Krakatoa v1.0.0 and higher

  • The file KrakatoaGUI.ms defines a MAXScript struct containing functions called by the renderer itself and used to manage the User Interface.

  • The FranticParticleRenderMXS struct is an instance of the FranticParticleRenderMXSStruct definition.

  • To see its properties and functions, you can call

    show FranticParticleRenderMXS
    

Properties:

lastFrameRenderStartTime integer, default:0

  • Used by #preRenderFrame callbacks to store the rendering start time for measuring the render time that is stored in History files.

lastFrameRenderEndTime integer, default:0

lastFrameRenderTime integer, default:0

DeadlineDetected boolean, default:false

  • Contains true when Deadline Network Manager was detected on the computer, false when it is not installed.
  • Set by the function FranticParticleRenderMXS.DetectDeadline()

tagCounter integer, default:0

  • Used internally for TreeView controls generation.

lockSecondaryToPrimaryFloater boolean, default:true

theCacheablePropNames array

LoadSave_SingleRollout

PresetFilterString string, default:”“

KrakatoaPropertiesList array, default:

PreChangeRendererInstance

Functions:

User Interface Startup, Open and Close Functions

DetectDeadline()

  • This function detects the Frantic Films Deadline Network Manager on the system Krakatoa is running on and sets the FranticParticleRenderMXS.DeadlineDetected variable to true of false.

OpenGUI()

  • This function is being called by the Krakatoa Renderer>Open Scripted GUI button, but can be used by any script to open the Krakatoa GUI.
  • It is also being used by the KrakatoaGUI MacroScript defined in the KrakatoaGUI.ms file.

CancelGUI()

  • This function is being called by the Krakatoa Renderer, but is not implementing any functionality at this moment.

CloseGUI()

  • This function is being called by the Krakatoa Renderer, but is not implementing any functionality at this moment.

Render Initialization, Defaults and Preferences

InitRenderer()

  • This function is called when a new instance of the Krakatoa renderer is created.
  • It adds every property currently implemented in Krakatoa using a factory default or loads the default values stored as User Defaults to INI file (if available) by calling the initDefaultSetting() function described below.

initDefaultSetting <string>theKey <string>theDefault

  • This function is used to initialize the Krakatoa values to defaults when a new instance of the Krakatoa Renderer is being created.
  • Krakatoa provides two levels of defaults - factory defaults and user defaults.
  • The factory defaults are hard-coded in the KrakatoaGUI.ms file and applied to the renderer if no user defaults exist for the respective property.
  • The user defaults are stored locally in an INI file and will be used if a key with the given name exists in the INI file.
  • The function is called with two arguments - the first argument is the key name which is both the internal property name used by the AddProperty/GetProperty/SetProperty methods and the name of the INI file entry.
  • If the given key exists in the [Defaults] category of the INI file, its value will be used.
  • If no such key exists, the second argument will be used as the default value.
  • Then the function calls the AddProperty method and sets the initial value of the property to the default value.

saveCustomProperty <string>Key

  • This function saves the given property to a Key with the same name in the [Defaults] category of the KrakatoaDefaults.ini file.

PostLoadEvent()

  • This function is called after a new file is loaded. It can be used to add compatibility patches to adjust settings in files saved using older versions of Krakatoa.
  • Currently, no such patches are defined, but the function invokes a global UI refresh to update the Krakatoa GUI after a MAX file has been loaded.

GetDeadlineNetworkRoot()

  • This function returns the network root (location of the Deadline Repository) if Deadline is installed on the machine/network.
  • Otherwise returns empty string “”

increasePFlowSystemLimits()

  • This function increases the system limit of all scene Particle Flow emitters to 100 million if they are not already set to a higher value.
  • Note that the PFlow GUI will show only values up to 10 million, but internally the limit can be higher.

GlobalRefreshGUI()

  • This function calls the refresh_GUI() function in all rollouts of the Krakatoa GUI.

Render History Functions

InitTreeView <treeView> dotnet:<bool>

  • This function is being used to initialize a TreeView control.
  • <treeView> is an ActiveX or DotNet TreeView control.
  • The optional keyword dotnet: is false by default and assumes the TreeView is an ActiveX control.
  • When set to true, the TreeView will be assumed to be a DotNet control.

addChildren <treeView> <tvNode> <children> <parent> dotnet:<bool>

  • This function is being used to add children to a TreeView node.
  • <treeView> is an ActiveX or DotNet TreeView control.
  • <tvNode> is the TreeView node to add the children to.
  • <Children> is the array of UI controls and rollouts to be added to the TreeView.
  • <Parent> is the Parent object of the children being added, for example the rollout the UI controls belong to.
  • The optional keyword dotnet: is false by default and assumes the TreeView is an ActiveX control.
  • When set to true, the TreeView will be assumed to be a DotNet control.

fillInTreeView <treeView> dotnet:<bool>

  • This function is being used to populate a TreeView control.
  • <treeView> is an ActiveX or DotNet TreeView control.
  • The optional keyword dotnet: is false by default and assumes the TreeView is an ActiveX control.
  • When set to true, the TreeView will be assumed to be a DotNet control.

compareFN <index>valueIndex1 <index>valueIndex2 <array>valueArray

  • Used by the QuickSort function for indexed sort.

framePreRender()

  • Called by a FramePreRender Callback, stores the current time in the struct property lastFrameRenderStartTime which is then used to calculate the actual render or save time for the last frame.

sortFilesByDate <array>theFiles feedback:(#none|#history)

  • Sorts the files in the provided array by creation date.
  • If the optional feedback: parameter is set to #history, the function will also update the History feedback dialog. Default is #none.

loadPresetAll <filename>presetFile

  • Loads the given preset file.

saveRenderHistory()

  • This function is called by the PostRender callback registered by Krakatoa and stores a Render History file for the last rendering performed (only if the Krakatoa Scripted GUI is open and the Save Render History option is checked.
  • It is called by both image rendering and particle saving operations.
  • In the former case, it also saves the last rendered image to disk.

saveCustomDefaults()

  • This function saves all current settings from the Krakatoa Scripted GUI to an INI file which are used to initialize new instances of the Krakatoa Renderer.

presetToLoadDDLSelected <index>selectedListItem

  • This function is used to initialize the TreeView with the preset selected in the drop-down list at the bottom of the Load/Save Preset dialog.

displaySavePresetDialog()

  • This function implements the Presets Load/Save dialogs

loadRolloutPreset <rollout>rollout <filename>presetFile

  • This function loads the settings of the given rollout from the given preset file.

saveRolloutPreset <rollout>rollout <filename>presetFile

  • This function saves the settings of the given rollout to the given preset file.

loadSaveDialogOpen()

  • This function performs the opening of the load or save version of the dialog.

compareSettings <filename>File1 <filename>File2

  • This function performs the comparison of all settings in the two given files and returns an array of all difference including the category, key name, the value in the first file and the value in the second file.

loadSaveButtonPressed()

  • This function is called when the Load or Save button is pressed in the Load/Save Dialog.
  • It performs all operations necessary to load and save each rollout in the UI.

saveSceneInfo <filename>presetFile

  • This function saves information about the current 3ds Max scene to the given preset file.
  • The info includes object counts, particle counts, scene name and path and last particle rendering/saving time.

SetDropDownValue <control>dropDownList <string>value

  • This function sets the dropdown selection value to the item which matches the given string input.
  • The purpose of this is to store all drop down list items as text labels instead of integers, so the ordering and content of drop-down lists can be changed without breaking compatibility.
  • Wherever the internal name has to be replaced with a more descriptive name, KrakatoaGUI.ms performs remapping of the internal and UI names.

savePresetAll <filename>presetFile

  • This function loops through all rollouts scheduled for saving and calls the saveRolloutPreset function of each one of them.

Utility Functions

GetEarliestBirthFrame()

  • Returns the frame with the least Particle Flow particles.
  • Used when submitting multiple partition jobs to Deadline since saving files on a later frame would cause multiple and slow PFlow updates.

fixTimeString <string>timeString

  • Replaces all delimiters like : and / in a time string with underscores for use in file names.
  • For example
theTime = localtime
"6/15/2007 2:45:28 PM"
FranticParticleRenderMXS.fixTimeString theTime
"6_15_2007_2_45_28_PM"

LeadingZeros <integer>value <integer>count

  • Returns a string of leading zeroes for the given value.
  • The second parameter defines the total length of the resulting number,
  • For example
theValue = 123
123
theZeros = FranticParticleRenderMXS.LeadingZeros theValue 5
"00"
theZeros + theValue as string
"00123"

convertToHMS <integer>TimeInSeconds

  • Converts the time in seconds to hours:minutes:seconds format.
  • For example
FranticParticleRenderMXS.convertToHMS 123
"00:02:03"

getMaxVersionString()

  • Returns a string describing the current 3ds Max version, e.g. “3ds Max 2016 64 bit”

rebuildValueCache()

rebuildPathsCache()

addValueToKrakatoaHistoryCache()

saveAllValueCaches()

loadiniDefaultSettings()

storeCacheableSettings()

addToPathsCache()

displayRendererSwitchPrompt()

GetCompressOnSaveState()

exportPythonFile()

BackToMainControls()

OpenPRTVolumeOptionsRCMenu()

OpenPRTSurfaceOptionsRCMenu()

OpenPRTFumeFXOptionsRCMenu()

OpenPRTSourceOptionsRCMenu()

toggleRenderElementByClass()

defineShaderRollout()

createDefaultsRCMenu()

ToggleRolloutVisibility()

hasRenderElement()

getSceneMappingChannelsUsed()

calculateMemoryUsage()

convertTransform()

getGeoVolumeEstimatedCount()

checkForHairFarmEffect()

addCommas()

underscoreString()

framePostRender()

FloatRolloutButtonPressed()

isGeoSurface()

getShaderPropList

openRenderElementsDialog

prepareOBJExporterForKSR

getHashString

getChangedCacheableProperties

initDynamicShaderProperties

navigateToKrakatoaRollout

OpenKrakatoaAtmosphericDialog

OpenSpecificLightRenderElementOptionsRCMenu

PRTVolumeObjectSetupOnPick

SettingsUnmodifiedSinceCacheCreation

getFumeShaderParameters

OpenMagmaFlowEditor

closerRolloutFloaters

getValueFromKrakatoaHistory

RemoveRenderElement

IsCacheValid

CalculateVolume

getPropNames

addRenderElement

convertColorToPython

HFOV2VFOV

postRendererChanged

isGeoVolume

isPRTLoader

setDefaultMagmaFlow

fixNamedSelectionSets

floatOrDockRollout

collectHashSubAnims

updateIconColors

UpdateAllHiddenRollouts

getFileInfoDotNet

validateObjectNameAsFileName