XSI 2012 (
Posted: Tue Aug 02, 2011 2:25 pm
by CommanderGreg
Hi,
I want to say that I've already used the "Search" function in this forum, and the Support of Autodesk, but I've some problems with the (new) 2012 version.
1) If I want to save something, I get an error: "The disk is write protected", I've already changed the properties of the XSI "Save Scenes" folder to "NOT write protected", but the error still occurs.
2) I can't make friends with "Crosswalk 2012.0", it exports NOTHING...
3) I also can't export anything as model (.dae, .emdl)... but i can IMPORT everything...
4) Allthough I knew, that the Pandemic Mod tools are only usable with 4.x- 5.11 I tried to install them, and when i selected : File -> PlugIn Manager -> pandemic scripts.vbs -> *right click*-> reload; cmd starts and crashes with the message : "Microsoft Registryserver(?*) doesn't work any more"* and i have to click on "close program"; afterwards i get this in XSI:
And here I have the "pandemic scripts.vbs"..., line 377 is red, it is almost at the end of the script:
Is it possibly to get the pandemic modtools working in this version of XSI with changing something in this script or something other(I'm not a programmer or smth like that but I'm sure that someone is in this forum) ?... I know, by now, nobody has figured a solution for the earlier versions, but maybe does SOMEONE know a possibility except of MshEx or MshViewer?
Thank you very much , and please excuse my lousy English, I'm Austrian, and so i hope you understand everything...
CommanderGreg
I want to say that I've already used the "Search" function in this forum, and the Support of Autodesk, but I've some problems with the (new) 2012 version.
1) If I want to save something, I get an error: "The disk is write protected", I've already changed the properties of the XSI "Save Scenes" folder to "NOT write protected", but the error still occurs.
2) I can't make friends with "Crosswalk 2012.0", it exports NOTHING...
3) I also can't export anything as model (.dae, .emdl)... but i can IMPORT everything...
4) Allthough I knew, that the Pandemic Mod tools are only usable with 4.x- 5.11 I tried to install them, and when i selected : File -> PlugIn Manager -> pandemic scripts.vbs -> *right click*-> reload; cmd starts and crashes with the message : "Microsoft Registryserver(?*) doesn't work any more"* and i have to click on "close program"; afterwards i get this in XSI:
Code: Select all
- line 377 in C:\...\pandemic scripts.vbsHidden/Spoiler:
' Conglomerated by Mike Z
' NOTES:
' If packaging this plugin as an XSIAddon, go to Others and add mesh_exporter.dll to the list of things to package.
' The default dir it puts the DLL in is fine.
' ALSO, make sure the package installs itself into "Pandemic" under Installation Sub-directory, but
' which addons folder you put it in by default doesn't matter.
' -------------------------------------This section from EditFlags.vbs----------------------------------------------
sub ConvertATRBData(myObj)
Dim oldProp
set prim=myObj.ActivePrimitive
set geom = prim.Geometry
' move ATRB cluster data to MAT_ATRB customproperties
for each cls in geom.Clusters
if(Left(cls.name,4)="ATRB") then
' copy the data from MAT_cls.name customproperty
' create a new one, filling in the data
set oldProp = myObj.Properties("MAT_" & cls.name)
set newProp = myObj.AddProperty("ATRB2",,"MAT_" & cls.name)
for each param in oldProp.Parameters
val1=param.value
strpos = InStrRev(param.fullname, ".")
parName = Right(param.fullname,len(param.fullname)-strpos)
newProp.Parameters(parName).Value = val1
next
' set polygon ids for the material flags
s = ""
set oClusterElements = cls.Elements
aElements = oClusterElements.Array
for iIndex=lbound(aElements,1) to ubound(aElements,1)
s = s & aElements(iIndex)
if iIndex<ubound(aElements,1) then
s = s & ","
end if
next
newProp.Parameters("PolygonIDs").value = s
' delete the old customproperty
DeleteObj oldProp
SetValue newProp & ".Name", "MAT_" & cls.name
end if
next
' remove ATRB clusters
for each cls in geom.Clusters
if(Left(cls.name,4)="ATRB") then
RemoveCluster cls
end if
next
end sub
'---------------------------------------------
' Get Dialog
'---------------------------------------------
function get_dialog(out_prop, out_valid)
dim SceneRoot, DialPath, mysliders
out_valid = False
Set SceneRoot = application.activeproject.activescene.root
bFound = False
for each prop in SceneRoot.Properties
if prop.name = "Edit_Attributes" then
DeleteObj prop
end if
next
if not bFound then
set out_Prop = SceneRoot.AddProperty("ATRB2",,"Edit Attributes")
end if
On Error Resume Next
inspectobj out_Prop ,,,siModal
if Err.Number <> 0 then
exit function
end if
out_valid = True
end function
' Main Editflags function
' --------------------------------------------------------------------------
' This callback is where you provide the actual implementation of the
' command.
'
function EditFlags_VBS_Execute()
' Since this command uses no arguments, this callback function
' takes no input arguments either.
dim return, polyArray, atrbProp, atrbCluster, dlgProp
set return = GetValue("SelectionList")
for each obj in return
if obj.type = "polySubComponent" then
polyArray = obj.SubElements
set oPrim = getvalue(obj.obj)
set myObj = oPrim.Parent
set geom = oPrim.Geometry
' first, make sure ATRB data is in new format for this object
ConvertATRBData myObj
bFoundParam=False
get_dialog dlgProp,valid
if valid=True then
for each tempProp in myObj.Properties
if(Left(tempProp.name,8)="MAT_ATRB") then
if not bFoundParam then
bFoundParam=True
' is this the property/cluster i want to add polys too?
for each param in tempProp.Parameters
if param.name <> "PolygonIDs" then
val1="=" & param.value
strpos = InStrRev(param.fullname, ".")
parName = Right(param.fullname,len(param.fullname)-strpos)
val2="=" & dlgProp.Parameters(parName).Value
if val1 <> val2 then
bFoundParam = False
end if
end if
next
if bFoundParam then
set atrbProp = tempProp
end if
end if
' Remove selected polys from tempProp
s = tempProp.Parameters("PolygonIDs").value
dim sPolys
sPolys = Split(s,",")
for i=lbound(sPolys) to ubound(sPolys)
for each idx in polyArray
if "=" & idx = "=" & sPolys(i) then
sPolys(i) = ""
end if
next
next
s=""
for i=lbound(sPolys) to ubound(sPolys)
if sPolys(i)<>"" then
if s <> "" then
s = s & ","
end if
s = s & sPolys(i)
end if
next
tempProp.Parameters("PolygonIDs").value=s
if s = "" then
if atrbProp <> tempProp then
DeleteObj tempProp
end if
end if
end if
next
' create new property
if not bFoundParam then
set atrbProp = myObj.AddProperty("ATRB2",,"MAT_ATRB")
for each param in dlgProp.Parameters
strpos = InStrRev(param.fullname, ".")
parName = Right(param.fullname,len(param.fullname)-strpos)
atrbProp.Parameters(parName).value=param.value
next
end if
' add polys to property
s=atrbProp.Parameters("PolygonIDs").value
for each idx in polyArray
if s <> "" then
s = s & ","
end if
s = s & idx
next
atrbProp.Parameters("PolygonIDs").value=s
DeleteObj dlgProp
end if
end if
next
' All there is to do is log the finshed message
Application.LogMessage "EditFlags finished"
' Finish with success notification
EditFlags_VBS_Execute = true
end function
' --------------------------------------------------------------------------
' This callback allows you to declare the arguments to be used with this
' command as well as whether or not it returns a value. This is the same
' information as is available on the Arguments tab of the command editor.
'
function EditFlags_VBS_Init( in_context )
' Get the command object from the Context input
set oCmd = in_context.Source
' Since we will not use any arguments in this command, we only have
' to indicate the lack of return values
oCmd.ReturnValue = false
' Finish with success notification
EditFlags_VBS_Init = true
end function
' -------------------------------------End section from EditFlags.vbs----------------------------------------------
' -----------------------------------This section from XSI2MSHExporter.vbs------------------------------------------
' traverse a 3d object hierarchy and print parent + children names
sub TraverseHierarchy1( obj)
dim i
Set prims=obj.Primitives
if obj.type = "polymsh" then
' *** New test for SpecWar -- don't reset scale proxy objects
' *** if they're scaled spheres...
if Left(obj.Name, 2) <> "p_" then
Scale obj, 1.000, 1.000, 1.000, siAbsolute, siView, siCtr, siXYZ
if obj.Envelopes.Count>0 then
SetValue obj & ".polymsh.envelopop.mute", True
end if
else
' is a proxy
On Error Resume Next
dim teststr, testval
teststr = obj.Name & ".primitive.sphere.radius"
testval = GetValue(teststr)
if Err.Number <> 0 then
On Error Resume Next
teststr = obj.Name & ".primitive.cube.length"
testval = GetValue(teststr)
if Err.Number <> 0 then
On Error Resume Next
teststr = obj.Name & ".primitive.cylinder.radius"
testval = GetValue(teststr)
if Err.Number <> 0 then
' not originally a cylinder or sphere or cube, so force scaling?
Scale obj, 1.000, 1.000, 1.000, siAbsolute, siView, siCtr, siXYZ
end if
end if
end if
end if
end if
for i = 0 to obj.children.count - 1
TraverseHierarchy1 obj.children(i)
next
end sub
' traverse a 3d object hierarchy and print parent + children names
sub TraverseHierarchy2( obj)
dim i
Set prims=obj.Primitives
if obj.type = "polymsh" then
if obj.Envelopes.Count>0 then
SetValue obj & ".polymsh.envelopop.mute", False
end if
end if
for i = 0 to obj.children.count - 1
TraverseHierarchy2 obj.children(i)
next
end sub
' --------------------------------------------------------------------------
' This callback is where you provide the actual implementation of the
' command.
'
function XSI2MSHExporter_VBS_Execute()
' Since this command uses no arguments, this callback function
' takes no input arguments either.
' ****
' **** XSI2MSH Exporter
' ****
'option explicit
dim root,Obj,prims,prim
' start with root
set root = application.activeproject.activescene.root
TraverseHierarchy1 root
Set Obj=CreateObject("XSI2MSHExporter3.XSISceneExporter3")
Obj.ExportScene ActiveProject, ActiveProject.ActiveScene
TraverseHierarchy2 root
' All there is to do is log the finshed message
Application.LogMessage "XSI2MSHExporter finished"
' Finish with success notification
XSI2MSHExporter_VBS_Execute = true
end function
' --------------------------------------------------------------------------
' This callback allows you to declare the arguments to be used with this
' command as well as whether or not it returns a value. This is the same
' information as is available on the Arguments tab of the command editor.
'
function XSI2MSHExporter_VBS_Init( in_context )
' Get the command object from the Context input
set oCmd = in_context.Source
' Since we will not use any arguments in this command, we only have
' to indicate the lack of return values
oCmd.ReturnValue = false
' Finish with success notification
XSI2MSHExporter_VBS_Init = true
end function
' -----------------------------------End section from XSI2MSHExporter.vbs------------------------------------------
' --------------------------------------------------------------------------
' This callback defines the menu entry for this plug-in.
'
function PandemicTools_Init( in_context )
' Get the menu object from the Context input
set oMnu = in_context.Source
' Add a command item
oMnu.AddCommandItem "Export Mesh", "XSI2MSHExporter_VBS"
' Add a command item
oMnu.AddCommandItem "Edit Flags", "EditFlags_VBS"
' Finish with success notification
PandemicTools_Define = true
end function
' This is the callback that tells XSI what plug-ins are available so that
' when they are invoked, XSI will read the appropriate definition callbacks
'
function XSILoadPlugin( in_reg )
' Set up some basic information for the whole plug-in
in_reg.Name = "XSI Exporter"
in_reg.Author = "Pandemic Studios, with help"
in_reg.Email = ""
in_reg.URL = "http://www.pandemicstudios.com/"
in_reg.Major = 1
in_reg.Minor = 0
' Register the command as one of the plug-in
' items for the plug-in
in_reg.RegisterCommand "XSI2MSHExporter_VBS", "MSHExport"
in_reg.RegisterCommand "EditFlags_VBS", "EditFlagsCommand"
' Register a Menu as another plug-in item to appear
' as a flat entry on the Help menu
in_reg.RegisterMenu siMenuMainFileSceneID, "Pandemic Tools", true
' You can also log a message about this plug-in's installation
Application.LogMessage "Attempting to register DLL..."
' Attempt registering the DLL in both the user and the generic addon directories - Windows only, of course.
myAddonDLL = Application.InstallationPath ( siAddonPath ) & "\Pandemic\Application\bin\nt-x86\mesh_exporter.dll"
myUserAddonDLL = Application.InstallationPath ( siUserAddonPath ) & "\Pandemic\Application\bin\nt-x86\mesh_exporter.dll"
System "regsvr32 /s " & myAddonDLL
System "regsvr32 /s " & myUserAddonDLL
' You can also log a message about this plug-in's installation
Application.LogMessage "The Pandemic MSH Exporter plug-in has been " _
& "successfully installed."
' Finish with success notification
XSILoadPlugin = true
end function
' NOTES:
' If packaging this plugin as an XSIAddon, go to Others and add mesh_exporter.dll to the list of things to package.
' The default dir it puts the DLL in is fine.
' ALSO, make sure the package installs itself into "Pandemic" under Installation Sub-directory, but
' which addons folder you put it in by default doesn't matter.
' -------------------------------------This section from EditFlags.vbs----------------------------------------------
sub ConvertATRBData(myObj)
Dim oldProp
set prim=myObj.ActivePrimitive
set geom = prim.Geometry
' move ATRB cluster data to MAT_ATRB customproperties
for each cls in geom.Clusters
if(Left(cls.name,4)="ATRB") then
' copy the data from MAT_cls.name customproperty
' create a new one, filling in the data
set oldProp = myObj.Properties("MAT_" & cls.name)
set newProp = myObj.AddProperty("ATRB2",,"MAT_" & cls.name)
for each param in oldProp.Parameters
val1=param.value
strpos = InStrRev(param.fullname, ".")
parName = Right(param.fullname,len(param.fullname)-strpos)
newProp.Parameters(parName).Value = val1
next
' set polygon ids for the material flags
s = ""
set oClusterElements = cls.Elements
aElements = oClusterElements.Array
for iIndex=lbound(aElements,1) to ubound(aElements,1)
s = s & aElements(iIndex)
if iIndex<ubound(aElements,1) then
s = s & ","
end if
next
newProp.Parameters("PolygonIDs").value = s
' delete the old customproperty
DeleteObj oldProp
SetValue newProp & ".Name", "MAT_" & cls.name
end if
next
' remove ATRB clusters
for each cls in geom.Clusters
if(Left(cls.name,4)="ATRB") then
RemoveCluster cls
end if
next
end sub
'---------------------------------------------
' Get Dialog
'---------------------------------------------
function get_dialog(out_prop, out_valid)
dim SceneRoot, DialPath, mysliders
out_valid = False
Set SceneRoot = application.activeproject.activescene.root
bFound = False
for each prop in SceneRoot.Properties
if prop.name = "Edit_Attributes" then
DeleteObj prop
end if
next
if not bFound then
set out_Prop = SceneRoot.AddProperty("ATRB2",,"Edit Attributes")
end if
On Error Resume Next
inspectobj out_Prop ,,,siModal
if Err.Number <> 0 then
exit function
end if
out_valid = True
end function
' Main Editflags function
' --------------------------------------------------------------------------
' This callback is where you provide the actual implementation of the
' command.
'
function EditFlags_VBS_Execute()
' Since this command uses no arguments, this callback function
' takes no input arguments either.
dim return, polyArray, atrbProp, atrbCluster, dlgProp
set return = GetValue("SelectionList")
for each obj in return
if obj.type = "polySubComponent" then
polyArray = obj.SubElements
set oPrim = getvalue(obj.obj)
set myObj = oPrim.Parent
set geom = oPrim.Geometry
' first, make sure ATRB data is in new format for this object
ConvertATRBData myObj
bFoundParam=False
get_dialog dlgProp,valid
if valid=True then
for each tempProp in myObj.Properties
if(Left(tempProp.name,8)="MAT_ATRB") then
if not bFoundParam then
bFoundParam=True
' is this the property/cluster i want to add polys too?
for each param in tempProp.Parameters
if param.name <> "PolygonIDs" then
val1="=" & param.value
strpos = InStrRev(param.fullname, ".")
parName = Right(param.fullname,len(param.fullname)-strpos)
val2="=" & dlgProp.Parameters(parName).Value
if val1 <> val2 then
bFoundParam = False
end if
end if
next
if bFoundParam then
set atrbProp = tempProp
end if
end if
' Remove selected polys from tempProp
s = tempProp.Parameters("PolygonIDs").value
dim sPolys
sPolys = Split(s,",")
for i=lbound(sPolys) to ubound(sPolys)
for each idx in polyArray
if "=" & idx = "=" & sPolys(i) then
sPolys(i) = ""
end if
next
next
s=""
for i=lbound(sPolys) to ubound(sPolys)
if sPolys(i)<>"" then
if s <> "" then
s = s & ","
end if
s = s & sPolys(i)
end if
next
tempProp.Parameters("PolygonIDs").value=s
if s = "" then
if atrbProp <> tempProp then
DeleteObj tempProp
end if
end if
end if
next
' create new property
if not bFoundParam then
set atrbProp = myObj.AddProperty("ATRB2",,"MAT_ATRB")
for each param in dlgProp.Parameters
strpos = InStrRev(param.fullname, ".")
parName = Right(param.fullname,len(param.fullname)-strpos)
atrbProp.Parameters(parName).value=param.value
next
end if
' add polys to property
s=atrbProp.Parameters("PolygonIDs").value
for each idx in polyArray
if s <> "" then
s = s & ","
end if
s = s & idx
next
atrbProp.Parameters("PolygonIDs").value=s
DeleteObj dlgProp
end if
end if
next
' All there is to do is log the finshed message
Application.LogMessage "EditFlags finished"
' Finish with success notification
EditFlags_VBS_Execute = true
end function
' --------------------------------------------------------------------------
' This callback allows you to declare the arguments to be used with this
' command as well as whether or not it returns a value. This is the same
' information as is available on the Arguments tab of the command editor.
'
function EditFlags_VBS_Init( in_context )
' Get the command object from the Context input
set oCmd = in_context.Source
' Since we will not use any arguments in this command, we only have
' to indicate the lack of return values
oCmd.ReturnValue = false
' Finish with success notification
EditFlags_VBS_Init = true
end function
' -------------------------------------End section from EditFlags.vbs----------------------------------------------
' -----------------------------------This section from XSI2MSHExporter.vbs------------------------------------------
' traverse a 3d object hierarchy and print parent + children names
sub TraverseHierarchy1( obj)
dim i
Set prims=obj.Primitives
if obj.type = "polymsh" then
' *** New test for SpecWar -- don't reset scale proxy objects
' *** if they're scaled spheres...
if Left(obj.Name, 2) <> "p_" then
Scale obj, 1.000, 1.000, 1.000, siAbsolute, siView, siCtr, siXYZ
if obj.Envelopes.Count>0 then
SetValue obj & ".polymsh.envelopop.mute", True
end if
else
' is a proxy
On Error Resume Next
dim teststr, testval
teststr = obj.Name & ".primitive.sphere.radius"
testval = GetValue(teststr)
if Err.Number <> 0 then
On Error Resume Next
teststr = obj.Name & ".primitive.cube.length"
testval = GetValue(teststr)
if Err.Number <> 0 then
On Error Resume Next
teststr = obj.Name & ".primitive.cylinder.radius"
testval = GetValue(teststr)
if Err.Number <> 0 then
' not originally a cylinder or sphere or cube, so force scaling?
Scale obj, 1.000, 1.000, 1.000, siAbsolute, siView, siCtr, siXYZ
end if
end if
end if
end if
end if
for i = 0 to obj.children.count - 1
TraverseHierarchy1 obj.children(i)
next
end sub
' traverse a 3d object hierarchy and print parent + children names
sub TraverseHierarchy2( obj)
dim i
Set prims=obj.Primitives
if obj.type = "polymsh" then
if obj.Envelopes.Count>0 then
SetValue obj & ".polymsh.envelopop.mute", False
end if
end if
for i = 0 to obj.children.count - 1
TraverseHierarchy2 obj.children(i)
next
end sub
' --------------------------------------------------------------------------
' This callback is where you provide the actual implementation of the
' command.
'
function XSI2MSHExporter_VBS_Execute()
' Since this command uses no arguments, this callback function
' takes no input arguments either.
' ****
' **** XSI2MSH Exporter
' ****
'option explicit
dim root,Obj,prims,prim
' start with root
set root = application.activeproject.activescene.root
TraverseHierarchy1 root
Set Obj=CreateObject("XSI2MSHExporter3.XSISceneExporter3")
Obj.ExportScene ActiveProject, ActiveProject.ActiveScene
TraverseHierarchy2 root
' All there is to do is log the finshed message
Application.LogMessage "XSI2MSHExporter finished"
' Finish with success notification
XSI2MSHExporter_VBS_Execute = true
end function
' --------------------------------------------------------------------------
' This callback allows you to declare the arguments to be used with this
' command as well as whether or not it returns a value. This is the same
' information as is available on the Arguments tab of the command editor.
'
function XSI2MSHExporter_VBS_Init( in_context )
' Get the command object from the Context input
set oCmd = in_context.Source
' Since we will not use any arguments in this command, we only have
' to indicate the lack of return values
oCmd.ReturnValue = false
' Finish with success notification
XSI2MSHExporter_VBS_Init = true
end function
' -----------------------------------End section from XSI2MSHExporter.vbs------------------------------------------
' --------------------------------------------------------------------------
' This callback defines the menu entry for this plug-in.
'
function PandemicTools_Init( in_context )
' Get the menu object from the Context input
set oMnu = in_context.Source
' Add a command item
oMnu.AddCommandItem "Export Mesh", "XSI2MSHExporter_VBS"
' Add a command item
oMnu.AddCommandItem "Edit Flags", "EditFlags_VBS"
' Finish with success notification
PandemicTools_Define = true
end function
' This is the callback that tells XSI what plug-ins are available so that
' when they are invoked, XSI will read the appropriate definition callbacks
'
function XSILoadPlugin( in_reg )
' Set up some basic information for the whole plug-in
in_reg.Name = "XSI Exporter"
in_reg.Author = "Pandemic Studios, with help"
in_reg.Email = ""
in_reg.URL = "http://www.pandemicstudios.com/"
in_reg.Major = 1
in_reg.Minor = 0
' Register the command as one of the plug-in
' items for the plug-in
in_reg.RegisterCommand "XSI2MSHExporter_VBS", "MSHExport"
in_reg.RegisterCommand "EditFlags_VBS", "EditFlagsCommand"
' Register a Menu as another plug-in item to appear
' as a flat entry on the Help menu
in_reg.RegisterMenu siMenuMainFileSceneID, "Pandemic Tools", true
' You can also log a message about this plug-in's installation
Application.LogMessage "Attempting to register DLL..."
' Attempt registering the DLL in both the user and the generic addon directories - Windows only, of course.
myAddonDLL = Application.InstallationPath ( siAddonPath ) & "\Pandemic\Application\bin\nt-x86\mesh_exporter.dll"
myUserAddonDLL = Application.InstallationPath ( siUserAddonPath ) & "\Pandemic\Application\bin\nt-x86\mesh_exporter.dll"
System "regsvr32 /s " & myAddonDLL
System "regsvr32 /s " & myUserAddonDLL
' You can also log a message about this plug-in's installation
Application.LogMessage "The Pandemic MSH Exporter plug-in has been " _
& "successfully installed."
' Finish with success notification
XSILoadPlugin = true
end function
Thank you very much , and please excuse my lousy English, I'm Austrian, and so i hope you understand everything...
CommanderGreg