New in Softimage 2013: Script the codec for viewport captures


In Softimage 2013, you can use the ViewportCapture.DSCodec parameter to set the codec for your viewport captures.

DSCodec is an string that encodes the codec ID and parameters. To get the DSCodec value, do a viewport capture and set the Codec. Softimage will log the DSCodec value in the script history:

# INFO : ViewportCapture.DSCodec: AAAAFnNwdGxycHphAAAAAAAQAAACAAAAABR0cHJsAAACAAAeAAAAAAAYAAAAGGRyYXQAAAAAAAAAUwAAAQAAAAEAAAAACW1wc28AAAAADG1mcmEAAAAAAAAADHBzZnIAAAAAAAAACWJmcmEAAAAACm1wZXMAAAAAABxoYXJkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKc2RuZQAAAAAADGNtZnJhcHBsAAAAAA==

Here’s a Python snippet that shows how to set the DSCodec parameter:

from siutils import si
si = si()					# win32com.client.Dispatch('XSI.Application')
from siutils import log		# LogMessage
from siutils import disp	# win32com.client.Dispatch
from siutils import C		# win32com.client.constants

def dispFix( badDispatch ):
	    import win32com.client.dynamic
	    # Re-Wraps a bad dispatch into a working one:
	    return win32com.client.dynamic.Dispatch(badDispatch)

oViewportCapture = dispFix(si.Dictionary.GetObject( "ViewportCapture" ))
oViewportCapture.NestedObjects("File Name").Value = "C:\\test.mov";

oDSCodec = oViewportCapture.NestedObjects("DSCodec")

#log( oDSCodec.Value )
# INFO : ViewportCapture.DSCodec: AAAAFnNwdGxycHphAAAAAAAQAAACAAAAABR0cHJsAAACAAAeAAAAAAAYAAAAGGRyYXQAAAAAAAAAUwAAAQAAAAEAAAAACW1wc28AAAAADG1mcmEAAAAAAAAADHBzZnIAAAAAAAAACWJmcmEAAAAACm1wZXMAAAAAABxoYXJkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKc2RuZQAAAAAADGNtZnJhcHBsAAAAAA==

oDSCodec.Value = "AAAAFnNwdGxycHphAAAAAAAQAAACAAAAABR0cHJsAAACAAAeAAAAAAAYAAAAGGRyYXQAAAAAAAAAUwAAAQAAAAEAAAAACW1wc28AAAAADG1mcmEAAAAAAAAADHBzZnIAAAAAAAAACWJmcmEAAAAACm1wZXMAAAAAABxoYXJkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKc2RuZQAAAAAADGNtZnJhcHBsAAAAAA=="

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s