View Full Version : How difficult to port Maya plugins to XSI?
sdfritzshall
01-23-2007, 01:18 PM
I'm wondering just how involved a process it is to make Mental Ray plugins for Maya usable in XSI? I'm thinking particularly of the Photogrammetry Projection plugin- it would be incredibly useful for me, but I can't run it because I use XSI. Is it possible for someone like me- with no programming knowledge- to do this? If not, would someone else be willing to do it?
janimatic
01-25-2007, 11:07 AM
the difference is XSI use spdl where maya use mi files to declare shaders.
If you don't want to write spdl by hand you can use the shader wizard (from the plugin manager : new shader) and try to match the types and names of parameters.It will create an spdl. That doesn't really requiere programming knowledge. But it's not always easy (example : selection lists) or possible (example : multichannel output)
Though it would be nice if someone could write a simple mi2spdl utility....
mantom
02-09-2007, 12:17 PM
Most shaders can be ported with a simple mi --> SPDL conversion, but if a shader uses a function specific to Maya or XSI, then you're SOL as the shader would need to be recompiled to account for the differences. For example, diffuse/specular contribution from a light.
To make conversion less painless, I usually start with a SPDL template that has one of each type of possible parameter already defined, then I just copy and paste as needed and modify the parameter labels and defaults to match the .mi declaration. When I'm done, I change the GUID tags, run spdlcheck, then install.
sdfritzshall
02-10-2007, 11:12 PM
Most shaders can be ported with a simple mi --> SPDL conversion, but if a shader uses a function specific to Maya or XSI, then you're SOL as the shader would need to be recompiled to account for the differences. For example, diffuse/specular contribution from a light.
To make conversion less painless, I usually start with a SPDL template that has one of each type of possible parameter already defined, then I just copy and paste as needed and modify the parameter labels and defaults to match the .mi declaration. When I'm done, I change the GUID tags, run spdlcheck, then install.
I have no idea how to do any of that. I'm totally a beginner when it comes to things like this.
mantom
02-12-2007, 03:08 PM
I have no idea how to do any of that. I'm totally a beginner when it comes to things like this.
You can generate a SPDL template by using the XSI shader wizard to build a dummy shader and define one of each type of available parameter with common default values. You can do shader specific editting to match the SPDL with a .mi declaration using a simple text editor such as wordpad. The rest of the details concerning SPDL syntax and usage are covered in the SDK customization guides. Look under the mental ray section. The material is repeated in the online scripting reference when you press F1. Look under the SPDL section.
The only sections of the SPDL you need to concern yourself with are the top sections: Property Reference, Parameters, and MetaShader. Property Reference is the GUID of the shader so XSI can identify it. Parameters are the parameters of the shader and their min/max/default values and associated flags. The MetaShader section tells XSI how to apply the shader (texture, material, ...) along with additional flags for mental ray (trace on, shadow off, etc...). The rest is cosmetic stuff to make your PPG's pretty and can be ignored. If you have a compiler such as MSVC++, you can use GUIDGen.exe to generate GUID's for the shader parameters. Otherwise, you'll need to use the XSI Script editor to bang them out with this simple command:
LogMessage( XSIFactory.CreateGuid() );
You'll need to execute this line of script once for each shader parameter as the GUID for each parameter must be unique.
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.