Writing a Phenomenon for Softimage XSI and Mental Ray

July 2nd, 2006 by Stefano Jannuzzo - Viewed 40602 times - Popularity: 34% [?]




Some details

First, you have to declare the nodes you are going to exploit. We have four nodes here, each to be declared with a line:

Node <node name> = guid <node reference guid>

The node reference guid can be found as follows:

Right mouse click on the node name (Vector_state in the example) and choose Edit.

Initial Shader Tree

This will open the script editor, showing you the spdl file of the node (sib_state_vector.spdl). Simply copy and paste the Reference guid to your phenomenon spdl.

Once you have declared the four nodes, you can hardcode the parameters and establish the connections.

The vector_state node must be forced to output the Intersection point.

If you read further sib_state_vector.spdl, you’ll find the mode integer parameter, and down in the parameter default section you see that Intersection point corresponds to a value of 2.

Initial Shader Tree

The same thing for vector_to_scalar. Since we want the X component to be output, we must set the component value to 0.

The vector_state output must plug into the vector_2_scalar input. This is accomplished by setting

Connection "vector_2_scalar input::input" = "vector_state";

You continue similarly, except for the inputs that come directly from the spdl interface, instead that from hardcoded values or connection.

This is done by the interface keyword, followed by the parameter name.

The boolean switcher is our topmost node, which is then finally declared as our root.

Now you are ready to install the spdl file.

Choose File->Plug-in Manager, go to the SPDLs section and click Install.

Browse for your spdl and click Install.

The log will tell what happened and where the phenomenon was installed.

Initial Shader Tree

Now open a browser, go to the user folder and find the preset under the Shaders folder. Drag and drop it into the rendertree, replacing the old nodes, and you’re set.

Initial Shader Tree

You can download the full SPDL for your enjoyment.

If you have any comments or suggestions, please post in the comments below!

Popularity: 34% [?]

Pages: 1 2

14 Responses to “Writing a Phenomenon for Softimage XSI and Mental Ray”

  1. Luc-Eric says:

    This article looks ok on FireFox, but in Internet Explorer the large bitmaps aren”t being shrunk and the pagef formatting falls apart

  2. Luc-Eric, can you tell me if things are looking better? I think I may have fixed things but running IE7.0 I couldn”t see the issue to start with.

    Thanks,

  3. Luc-Eric says:

    yes it”s ok now

  4. Steven Caron says:

    is there any speed increase when rendering 1 phenomenon versus its many parts?

  5. Stefano Jannuzzo says:

    No, no speed change at all

  6. Patrick Piché says:

    Is it possible to find Shaders GUID by scripting. Exemble, selecting a shader in XSI Explorer, running a script and tell what is the GUID of this Shader?

  7. I don’t think, but I can’t be sure. However, as said, if you edit the shader spdl in the script editor (RMB + “Edit”) you have it there, after the “Reference” keyword

  8. Clyde says:

    Hi man! Your site is cool! Visit my sites, please:

  9. Eddie says:

    Amazing artwork! This is spectacularly done! Visit my sites, please:

  10. Sylvain says:

    Patrick, I think this is what the XSIUtils.DataRepository.GetIdentifier() method does, with siObjectCLSID as second parameter.
    For example:
    LogMessage( “GUID = ” + XSIUtils.DataRepository.GetIdentifier( Selection.Item(0), siObjectCLSID ) );

  11. Patrick Piché says:

    Thanks Sylvain. It’s a good start, I’m looking in a way to build those Phenomenon by script after building them in the Render Tree.

  12. [...] is an example of how sometimes you can write a phenomenon just to downgrade a more powerful node to get what you [...]

  13. I just wonder how this works. But the health of each person depends on this thing.

Leave a Reply