Below is a list of calls you can make to RPManager via MXS.
General
RPMdata.RMopenFloater() — open the RPManager UI
RPMdata.GetPassCount() — <integer> number of passes in the scene
RPMdata.GetPassSelection() — array of integers corresponding to the indices of the selected passes in the pass list.
RPMdata.SetPassSelection <int array> — array of integers corresponding to the indices of the selected passes in the pass list.
RPMdata.GetPassName <index>
RPMdata.SetPassName <index> <string>
RPMdata.GetPassOutputPath <index>
RPMdata.SetPassOutputPath <index> <string>
RPMdata.GetLocalAutoPathRoot <index>
RPMdata.GetPassRange <index> — returns a point 3, [<start>, <end>, <nthFrame>]
RPMdata.SetPassRange <index> <point2>
RPMdata.updateUI() — updates the UI with any scripted changes
RPMdata.SetPassCamera <index> <camera>
RPMdata.GetPassCamera <index> <camera>
RPMdata.GetPassChecked() — returns an array of what is checked by index
RPMdata.GetPassName <index> quiet:false
RPMdata.SetPassName <index> <inputString> fixInvalid:false quiet:false
RPMdata.SetPassBeforeScript <index> <inputString> quiet:false refreshUI:true
RPMdata.SetPassAfterScript <index> <inputString> quiet:false refreshUI:true
RPMdata.GetPassBeforeScript <index>
RPMdata.GetPassAfterScript <index>
RPMdata.GetBeforeAfterScriptEnabled <index>
RPMdata.SetBeforeAfterScriptEnabled <index> <bool>
RPMdata.GetPassTimeType <index>
RPMdata.SetPassTimeType <index> <input>
RPMdata.RMrefresh() — FULL rpmanger UI refresh, heavy duty
RPMdata.rmuiValues <index?> — refresh RPM UI after changing settings via script
RPMData.RMRestValues int passindex renderMode:true preview:false skipCamera:false skipVis:false
RPMData.GetRenderer <passindex> — returns an instance of the renderer for the pass which you can modify
RPMData.SetRenderer <passindex> <renderer> — replace the renderer that RPM will restore for a pass
Adding/Removing Passes:
RPMdata.AddPassSetup setname:“test” noEdit:true
or just rpmdata.addpasssetup()
RPMdata.RMdeleteItem #(passIndices) quiet:true
Before/After scripts
RPMdata.RMModifyValues 40 numbArray:#(1,2) input:“before script goes here”
RPMdata.RMModifyValues 41 numbArray:#(1,2) input:“after script goes here”
the numbarray are the passes, indexed into the current pass list.
Editing Pass Data
Here is a function you can use to modify common render parameters for a pass:
RPMData.RMModifyValues 1 numbarray:#(1,2,3)
will update the output path with whatever the path is as entered in the UI for passes 1 2 and 3 as they appear in the pass list.
RPMData.RMModifyValues 1 numbarray:#(1,2,3) input:“D:/temp/this.tga”
will update the path with the supplied input, and
RPMData.RMModifyValues 1 numbarray:#(1,2,3) input:“D:/temp/this.tga” noIO:true
will do the same but also not change the output format settings (ie 32 bit targa with compression, otherwise it gets the current settings that can be detected)
the function is this:
RPMData.RMModifyValues itemVal numbArray: input: focusItem: noIO:false
Focus item is simply to give focus to one of my UI elements, you need to feed it the item for it to work.
You'll need a list of itemvals, here are a bunch. I haven't checked if they work without other preparation, but it should get you started.
Note input is not hooked up for all indices - should be, I just haven't finished adding this to the function.
1 = output path (stored with forward slashes for path dividers) The 'setpassname' function does other checks for invalid names etc. so is safer to use.
2 = rendertimetype
3: rendusenet
4: renderHeight
5: renderWidth
6: useEnvironmentMap
7: renderPixelAspect
8: skipRenderedFrames
10:rendShowVFB
11:rendStart
12: rendEnd
13: rendFileNumberBase
14: rendHidden
15: rendNThFrame
16: RendForce2Side
17:RendFieldRender
18: RendAtmosphere
19: renderEffects
20: renderDisplacements
21: rendcolorcheck
22: rendsuperblack
23: setRendApertureWidth
24: backgroundColor
25: () –used for bg controller storage info, there is are functions for capturing/restoring the BG
27: camera name
28: name of the visibility set or layer or layer set
29: multipass render effect name
30: mpassEnabled = RPMan.MPOn.state
31: mpassRenderPerPass = RPMan.MPrepp.state
32: multi pass settings
33: more multi pass settings
42: bb critical priority
43: BB priority
46: rendPickupFrames
49: BB suspended
50: ambientColor = RPMan.ambColour.color
51: ()/*used for ambient color storage*/
55: should be able to feed this a renderer and it will store it
57: RadiosityPreferences.useAdvancedLighting
58: RadiosityPreferences.computeAdvancedLighting = RPMan.calcAdvLight.state
59: RPMan.singleFrameSpinner.value
60: RPMan.useCurTime.state
65:rendSimplifyAreaLights = RPMan.RMareaShadow.checked
66: auto path generate LOCAL PATH (Lcl Pth) checked
67: auto gen path root (path)
68: AutoPathEnabled.checked
69: RPMan.localExtension.text
70: use Global Output size checked
71: use global network Priority - must be used with input:, which should be a boolean for state
72: RPMnetsetup.priorityOffset.value
73: auto path generate LOCAL EXTENSION (Lcl extension) checked
78: the file save checkbox
81: camera 1 dropdownmenu item, and also string label, ie #(“Both”, “_right”)
82: camera 2 dropdownmenu item, and also string label, ie #(“Both”, “_right”)
83: camera 3 dropdownmenu item, and also string label, ie #(“Both”, “_right”)
Getting Pass Data:
You can get the data per pass using the above indices:
rpmdata.RMGetValues <propertyindex as per wiki page> <passindex>
Visibility Sets:
RPMVisSets.getNumVisSets()
RPMVisSets.getVisSetByName setName
RPMVisSets.getVisSetName numVis
RPMVisSets.setVisSetName setName nameString
RPMVisSets.getVisSetCount setName
RPMVisSets.getVisSetObjects setName
RPMVisSets.addObjectsToVisSet setName objSet
RPMVisSets.RemoveObjectsFromVisSet setName objArray
RPMVisSets.setVisSetToVisibleObjects setName selectedOnly:false
RPMVisSets.createVisibilitySet objArray title
RPMVisSets.deleteVisSet setName
RPMVisSets.duplicateVisSet setName
RPMVisSets.RMMakeVisFromVisible input — input needs to be the string that is the name
RPMVisSets.RMMakeVisFromAll input — input needs to be the string that is the name
RPMVisSets.RMMakeVisFromSelected input — input needs to be the string that is the name
RPMVisSets.RMMakeVisFromSupplied objArray input — input needs to be the string that is the name
Misc
RPMBuildOutputPaths.autoBuildPaths #(passArray) — auto build specified passes paths
RPMData.rmgetstordata passindex — will return the internal unique ID that RPM assigns to each pass on creation.
RPMData.SetObjPropPrefsData 3 true/false — enable/disable the “Remove RPMMaterial during render” option in the Capture Globals box on the properties tab
List RPManager UI controls using: RPMData.RPMan.controls
RPMdata.stripInitialMaterials() — strip all the initial materials from RPMMaterials (it stores the pre-assign mat)
Effects and Atmospherics:
RPMdata.GetPassEffectStates <passindex>
RPMdata.GetPassAtmosStates <passindex>
RPMdata.SetPassAtmosStates <passindex> <atmosIndex> <true/false>
PMdata.SetPassEffectStates <passindex> <atmosIndex> <true/false>
An array is returned for the Get calls - true/false in the same order maxscript returns when you do stuff like
getatmospheric 3
size is the number of atmospherics/effects.
Set is item by item, despite the function name being plural… If you feed the set with an out of range atmos/effect index they will return false.
Rebuilding the RPM UI lists after you have set the states:
RPMdata.RebuildAtmos <passindex> true
RPMdata.RebuildEffects <passindex> true
To update the reporting in the main pass list box columns:
RPMdata.restoreReffAtmReporting <which>
which: 1 is the effect list, 2 the atmos, and 3 does both.
Render Presets:
You can set which list item is displayed by calling:
rpmdata.rpman.RenderPresets.selection = 18
where 18 is the index of the pal D1 item (unless you change the list contents)
You can then update the other list, as well as restoring an item by calling:
rpmdata.createOutputSetDropdownlist()
rpmdata.rpman.RenderPresetsValues.selection = 1
rpmdata.rpman.restorePresetValue 1
the 'rpmdata.rpman.restorePresetValue 1' does the restoration, setting the output sizes.
Xrefs:
RPManager does not create/delete Xrefs on the fly, it enabled disables what is there so you can use many of the 3dsmax Xref functions.
Xref Rollout controls can be had through: RPMData.RPMxrefRollout.Controls.
To set xref properties you use:
RPManXref.ModifyXrefInfo numbArray which index input:<optional override>
After either setting the relevent UI value, or using the 'input' argument to control the value directly.
Numbarray is the array of RPM passes to operate on. Which is the index of the Xref. Index is the property index.
For this list of indices I am listing the control name for convenience:
1: PMxrefRollout.xVis.state — visible flag
2: RPMxrefRollout.xLights.state
3: RPMxrefRollout.xCameras.state
4: RPMxrefRollout.xShapes.state
5: RPMxrefRollout.xHelpers.state
6: RPMxrefRollout.xBox.state
7: RPMxrefRollout.xAnimation.state
8: RPMxrefRollout.xUseAltPath.state
9: RPMxrefRollout.altPathEditText.text
12: RPMxrefRollout.xUpdate.state
15: RPMxrefRollout.xEnable.state
17: RPMxrefRollout.xdelayedLoad.state
For example, to disable xref 2 on pass 3, you could do:
RPMData.RMopenfloater()
RPMData.RPMxrefRollout.xEnable.state = false;
RPManXref.ModifyXrefInfo #(3) 2 15;
Note: xref indices can get mixed up if you (say) add an xref, add another, remove the first and then add the first again. I'll need to add a call to return which is which, but if you have added the xrefs cleanly it will work.
Object Property Capture Sets:
RPMCaptureProps.getCapSetName capsetIndex
RPMCaptureProps.setCapSetName capsetIndex nameString
RPMCaptureProps.getCapSetCount capsetIndex
RPMCaptureProps.getCapSetObjects capsetIndex
RPMCaptureProps.getCapParamCount capsetIndex
RPMCaptureProps.getcapsetIndexSets()
RPMCaptureProps.getTotalCapSetCounts() selected:false
RPMCaptureProps.isObjInSet node – returns set
RPMCaptureProps.clearMembers capsetIndex
RPMCaptureProps.getObjectsInCaptureSets needProps:<array, string, required property name>
RPMCaptureProps.getMaterialArray node
RPMCaptureProps.getPropertyArray obj prop – prop is a string name of the property, ie 'visibility'.
RPMCaptureProps.addObjectsToSet capsetIndex objArray suppressProgress:false
RPMCaptureProps.removeObjectsFromSet capsetIndex objArray dontOfferInitial:false restoreinitial:false
RPMCaptureProps.selectObjInSets capsetIndex
RPMCaptureProps.createCaptureObjectSet()
RPMCaptureProps.deleteCaptureObjectSet indexArray
RPMCaptureProps.duplicateSet capsetIndex
RPMCaptureProps.OPcapture_initialProps capSetArr restoreDeleted:false – these are the props that can be restored if you remove
RPMCaptureProps.OPcapture_layer capSetArr #(passarray[i]) allProps:false initValues:true ignoreDlg:true
Object Properties:
To assign properties. Right now the custom property assignment is limited, just the userpropbuffer, but the rest is available.
There are two functions. The first builds an array of properties to add and remove, the second does the adding.
You first need to call
RPMCaptureProps.getMyPropDefinitions geoinputarray:#() lightinputarray:#() caminputarray:#() custominputarray:#()
Each of these arrays should contain the properties you want to add/keep for the assignment.
NOTE: Property names are always strings.
ie
RPMCaptureProps.getMyPropDefinitions geoinputarray:#(“primaryVisibility”)
will create a data set which will add this property, and remove any not defined.
The data set is a largish, but you can call it to see what the property names are, ie
RPMCaptureProps.getMyPropDefinitions()
So you would first do
toCapture = RPMCaptureProps.getMyPropDefinitions geoinputarray:#(“primaryVisibility”)
then you would call the second function, feeding it both the capture set indexes you want to operate on, and the data set you just built:
RPMCaptureProps.assignCaptureProperties #(1) toCapture
This should then capture the primary visibility (visible to camera) property for any objects in capture set one. The #(1) is the index of the capture set. Don't give it an invalid index else it will error. One set at a time is probably recomended, though it supports multiple. Remember properties not specified are removed.
To help this out, you can get the properties from a set using:
RPMCaptureProps.getCapSetProperties <index of capture set>
this returns an array of
#(geometrypropsarray, lightpropsarray, campropsarray, custompropsarray)
ie
#(#(“primaryVisibility”), #(), #(), #())
for the above defined property.
NOTE: The capture set list will not update the properties count column at this stage, click in it to update.
Examples:
How you might control some RPManager values by setting the UI controls themselves:
rpmdata.rmopenfloater() – note if you call this by shift-evaluating in an mxs windows, it will close: RPM tests the shift key in this function.
passcount = rpmdata.getpasscount()
for i in 1 to passcount do