Category Archives: Softimage XSI

LemonRender – Batch Renderer

As a Softimage user, I’m not given any kind of render manager software like the straight forward but useful application that is backburner. I’ve worked at many studios and used many render farms (including backburner) but some of the main ones are Royal Render, Deadline . Anyway these ones are can be quite complex, and if you start beta testing a renderer like VRay in Softimage, you can come up against issues. I’ve now found that while I wait for a new version of Deadline, Softimage 2013 isn’t supported either….. So I’ve gone back to using this wee batch rendering system I made last year.

It involves only a few elements:

  • a plugin/submitter for Softimage
  • a batch file that runs…..
  • the main Lemon Render Python script
  • a simple web interface (run by a simple web server)
From this though, I can print logs of my renders to see how long they have been taking, and queue up jobs. These are all just stored (from the submitter) in simple text files which I can later alter/delete etc.
At the moment there is no priority,  the only thing a user can do is pause jobs in the queue.
I’m sure I could easily write plugins for Maya/Max/Nuke too but have never gotten around to it.
If there is any interest in it then I may do so!

lightbox

Softimage XSI Custom Menu

The easiest way to access your own, or third party scripts from the UI in Softimage XSI is creating a toolbar. With these you can simple drag & drop text from the script editor onto your own toolbar, then save that in your user or workgroup folders.
That is fine, but they don’t really have place to dock them to the layout.

Instead of that, my much preferred way is to create your own custom menu in the menu bar.

I recall not really finding much information of how to make these custom menus for XSI, the help file has never really provided much information, but the best way to start usually would be to make a custom property from the wizard.
Animate > Create > Parameter > Custom Property Wizard

This isn’t specifically for making a menu, but it creates a plugin script that you can then open and it may help you understand some of the concepts associated with a plugin.

(as it says in the old/not amazingly useful wiki here: http://softimage.wiki.softimage.com/index.php/Custom_Menus).

So to save you all that trouble, here is a basic custom menu template that you can easily use and adopt for your own menus.

The following code should be saved as a Python file (.py) in the Application/Data/Plugins directory.
I would always recommend creating your own workgroup which is software version independent, and others can connect to (potentially very useful for a custom menu where you might be sharing studio tools on a server)

You will see I have saved the version on the script file which aligns with the versioning in the script:

If you use these, XSI will always load the latest version.

I have commented in the example script where you should insert your own code – but if you use as is, it should display the example menu correctly.

I’m sure I had some good help/spying at their menus from Juan Brockhaus (nice website link I found here for him), Andy Nicholas and Peter Agg over the last couple of years in this area to thanks to them!

If you have any comments then ask below!

Python Scripting in Softimage XSI: Selection

I was originally planning to post purely about the incredibly useful simple task of making a loop to do repetitive tasks for you. You don’t need to be a TD for this to make things easier day to day, modelling, texturing, lighting, scene organising etc. You could use this in any situation.
ANYWAY as I wrote it I realised I was getting deep into some fundamentals whilst I was explaining how to access the object selection. So For this post I’ll just stick to selection and then advance that in the loop later.

    • Using this command, you can access the objects that are currently selected:

      This is a collection, so if you were to ‘print’ that command, you wouldn’t get great feedback about what it contains.
      In the following code examples, the lines that begin with # hashes show the results of the previous line of code when they are run.

      Note: if you ‘comment’ out a line in a script with the # it will be ignored when run – thus you can use it for commenting your code)

      See! Not so helpful. But as a collection, you can iterate through it using a ‘for loop’. Good old loop.

      Here there are a couple of important things to note in the loop.
      The indent is used by python instead of {} or things like that in other code. So after the loop begins, the next line that is INSIDE that loop, is in the indent, when lines stop being indented, the loop is over – it should be clear to read.
      “oObject” is a variable being declared at this point to be used in the loop. So you can name this whatever you like it is not in relation to anything previously (this is something that confused me to begin with so I’ll try and make that clear)
      I prefix the variables with ‘o’ to make it clear what they are, I picked this up from somewhere..

      So that’s the way to access each object in a loop. I’ll write up why that’s useful in the next post about loops specifically.

    • If you want to specifically pick the first, last, or any other object by index you can do that too.
      Note here I will create variables and then print whatever they contain, instead of printing the full command, this is a main principle while scripting, for tidiness, clarity of reading, organising, swapping data in and out.. And other great mysterious reasons I don’t understand.

      So that’s getting the first object (or ONLY object if there’s only one selected)
      Arrays/indices always start from 0 in scripting, so the FIRST index is always 0. Keeping that in mind, how to get the last object…

      To do that you need to get the length of the selection – the number of objects selected.
      For instance if you have 4 selected, the indices would be 0,1,2,3. So after getting the length (4) you need to subtract 1 to get the last index in the list. To get the length, use this command:

      Then you can use it like so, subtracting 1:

I guess that is about that for accessing the selection! I’ll write about what to do with the selection with loop later.

sr_CleanCurve

I made this script when I discovered a decent way to clean a curve so that I could make a bike chain in ICE. There is an operator called ‘reparametrize’ but that doesn’t do the job fully.
Also I have attached my ICE Compound to distribute points along a curve but that’s not entirely what this is about in case that has problems 🙂

Note:
For CLOSED curves this seems to be working very well, OPEN curves are more trouble but I added something in so the script will close it for you and you have to do some manual work after.
All is explained in the video above!

Installation:
If you don’t have a Workgroup outside of the installation dir and your user (which changes every version of XSI) then I would recomment creating one.

For any of those options, the “sr_CleanCurve” python script should be extracted to:
\XSI_Workgroup\Application\Plugins\
And “sr_DistributePointsOnCurve.1.4.xsicompound” goes into:
\XSI_Workgroup\Data\Compounds\ (create this folder if it doesn’t exist)

Please ask any questions here, also try me on twitter.

Bike Chain in ICE

[vimeo clip_id=27777795]
Here is a quick video of a bike chain I’ve put together in ICE within XSI using a node I had previously created to distributed points along a curve.

Perhaps more crucially distributing points on a curve evenly can be trouble because of the curve itself. But I have managed to work out a method that should help.. I’ll post more on this shortly.