VBScript compilation errors with Python PPG logic

On a machine that has Softimage 2011 or 2011 SP1 installed, but not Python, you’ll get VBScript compilation errors when you run a script or plugin that uses Python for the PPGLayout.Logic of a dynamic (on-the-fly) property. For example, running this script

xsi = Application
oRoot = xsi.ActiveSceneRoot
oProp = oRoot.AddProperty("CustomProperty", False, "test")
oLayout = oProp.PPGLayout
oLayout.Language = "Python"
oLayout.Logic ="""
Application.LogMessage('Hello world')
xsi.InspectObj( oProp )

will give this VBScript syntax error:

# ERROR : Syntax error - [line 2]
# ERROR : Property Page Script Logic Error (Microsoft VBScript compilation error)
# ERROR :    [1] (null)
# ERROR :   >[2] Application.LogMessage('Hello world')
# ERROR :    [3] (null)
# ERROR : 	Syntax error

This happens because Softimage 2011 doesn’t detect the Python installed with Softimage, so it falls back to the default VBScript when it tries to execute the Python PPG.Logic code. However, Python works as usual in all other respects (note that the above errors are logged as Python comments!).

You can workaround this by setting PPGLayout.Language to “pythonscript”.

Or you could leave the Language set to “Python” and add these registry entries to your system.
This way you don’t have to update existing code.

@="Python ActiveX Scripting Engine"



To add the registry entries, save the above in a .reg file and then double-click it.