Toggling LUT on and off for the render region


Here’s a simple self-installing plugin that adds a “Toggle LUT” command to the viewport Display menu. You can use this hide/show gamma correction in the render region while you’re working on the lighting of your scene (eg for film work, to toggle between the linear display and the “print space” lut).

To install this plugin, copy the code and save it in a .py file in the Application\Plugins folder of the User location or a workgroup. Then either restart Softimage or use the Plugin Manager to load the new plugin. After the plugin is loaded, you can use File > Keyboard Mapping to assign a shortcut key to the ToggleLut command.

# ToggleLUT
# Initial code generated by Softimage SDK Wizard
# Executed Wed Jun 15 05:51:55 EDT 2011 by blairs
import win32com.client
from win32com.client import constants

null = None
false = 0
true = 1

def XSILoadPlugin( in_reg ):
	in_reg.Author = "blairs"
	in_reg.Name = "ToggleLUT"
	in_reg.Major = 1
	in_reg.Minor = 0

	in_reg.RegisterCommand("ToggleLUT","ToggleLUT")
#	in_reg.RegisterMenu(constants.siMenuVMCameraID,"Camera_Toggle_LUT",false,false)
	in_reg.RegisterMenu(constants.siMenuVMDisplayID,"Display_Toggle_LUT",false,false)
	#RegistrationInsertionPoint - do not remove this line

	return true

def XSIUnloadPlugin( in_reg ):
	strPluginName = in_reg.Name
	return true

def ToggleLUT_Init( in_ctxt ):
	oCmd = in_ctxt.Source
	oCmd.Description = ""
	oCmd.ReturnValue = true

	return true

def ToggleLUT_Execute(  ):

	rr = Application.Preferences.GetPreferenceValue("Display.color_management_render_region")
	Application.Preferences.SetPreferenceValue("Display.color_management_render_region", not(rr) )

	return true

def Display_Toggle_LUT_Init( in_ctxt ):
	oMenu = in_ctxt.Source
	oMenu.AddCommandItem("ToggleLUT","ToggleLUT")
	return true

Raycasting to points on the opposite side of a mesh



Based on a recent thread on the XSI mailing list, here’s a simple example of using raycast to find points on the other side of a mesh.

In a nutshell:

  • Negate the point normal so it points inside the mesh, and use that as the raycast direction.
  • For the start position of the raycast, don’t use the PointPosition (because you’ll just get the same point back as the raycast hit). Instead, move along the normal a bit and use that as the starting point for the raycast.
  • In 2012, you can use the VertexIndex attribute to get the ID of the “opposite” point.

Green points in the viewport???



Now and again a customer will report that they’re getting these green points in the viewport, and they can’t get rid of them.
“Green points” are how “affected points” are displayed in the Shape Manager, but they shouldn’t show up in the viewport.

This usually happens with reference models.
The solution is to clear the Clusters check box in the Delta, and re-load the model.

hat tip: User hamairon on xsibase.

Troubleshooting satellite rendering with Process Monitor


In this video, I take a look at what to look for in a Process Monitor log from a satellite rendering computer. If you don’t see what I’m showing, then the master is not connecting to the satellite.

To use Process Monitor to confirm whether the master connects to the satellite:

  1. On the satellite machine, download Process Monitor.
  2. Extract Process Monitor from the downloaded file, and start procmon.exe.
  3. On the master machine, start Softimage. The master connects to the satellite at startup.
  4. After Softimage starts up on the master machine, go back to the satellite machine and stop capturing events in Process Monitor.
  5. Review the Process Monitor log (see the video for more info).

Using LUT files in Softimage 2012


There seems to be a bit of UI glitch in the Color Management preferences PPG. If you choose From LUT File in the Source list, you cannot select a LUT file from the Filename list. In fact, the Filename list just lists No LUT.

Here’s a couple of workarounds:

  • Set the LUT file through scripting:
    Application.SetValue("preferences.Display.color_management_source", 1, "")
    Application.SetValue("preferences.Display.color_management_lut_filename", "sRGB_10bits.lut", "")
    
  • Use this modified factory SPDL:
    $XSI_HOME/Application/spdl/C3DPrefsDisplay.spdl
    I tested this on my own install, but still, “use at your own risk”.

BTW, this issue is already logged and fixed internally.