If you are interested in testing and/or improving the ICEd Polygoniser, you can subscribe to this group.
See you there !
Guillaume
| ICEdPolygoniseProject |
| Visit this group |
If you are interested in testing and/or improving the ICEd Polygoniser, you can subscribe to this group.
See you there !
Guillaume
| ICEdPolygoniseProject |
| Visit this group |
Categories: dev · programming · xsi

I’m working on the Polygonise project in my spare time and so the progress are slow. Sometime I just spend a couple of hours by week , sometime it stops for two weeks or more. So the idea is to share the development very soon !
I think Softimage really miss this kind of tool. The faster it will happen, the better it will be.
There is no link to the source for the moment just because I need to spend a little time to make the code readable by a non-frenchdog user
.
If you are interested to try or improve this plugin, feel free to send me an email at “guillaume dot laforge dot 3d at gmail dot com”.
If I’ve got many request, maybe I will create a google group to share the ideas !
See you soon !
Guillaume Laforge
Categories: dev · programming · xsi
Now that you know the purpose of the Expression() object, I’m going to show some examples. I hope you will find it easier and more elegant than the classic string concatenation (and also I hate the word “konkatenation”).
First example : We really need to clamp a null position inside a cube to create the best character rig ever done (simple as that).
There is no built in clamp function in XSI (I know, it sucks…). Instead we can use a conditional expression or a combination of MIN and MAX expressions. On top of that, you add the script concatenation and it will looks like a very ugly thing. Fortunately, the brand new Expression object is there to save your mental health ! Lets code now :
#First you import the xsi_expr module and get the Expression class
#(I presum that you already know a way to set a path to a module from xsi)
import xsi_expr
from xsi_expr import Expression
#Then the ‘exotic’ XSI python things
xsi = Application
xsilog=xsi.LogMessage
#Lets build a simple implicit cube and a null
cube = xsi.ActiveSceneRoot.AddGeometry(“cube”)
nullInsideCube = xsi.ActiveSceneRoot.AddNull(‘inside_cube’)
#Then the null x, y z positions parameters
nullPosx = nullInsideCube.posx
nullPosy = nullInsideCube.posy
nullPosz = nullInsideCube.posz
#Here is the first Expression Object to get the cube limits from its length.
cubeLimitMax=Expression(cube.length)
cubeLimitMax.div(2)
#Then we create the min limit from the max limit like this:
cubeLimitMin=Expression()
cubeLimitMin.sub(cubeLimitMax.Value)
#Then we can create the expressions objects for the position x, y ,z of the null.
posInCubeX = Expression()
posInCubeX.clamp(nullPosx, cubeLimitMin.Value, cubeLimitMax.Value)
posInCubeY = Expression()
posInCubeY.clamp(nullPosy, cubeLimitMin.Value, cubeLimitMax.Value)
posInCubeZ = Expression()
posInCubeZ.clamp(nullPosz, cubeLimitMin.Value, cubeLimitMax.Value)
#And finally apply the expressions to the parameters
nullPosx.AddExpression(posInCubeX.Value)
nullPosy.AddExpression(posInCubeY.Value)
nullPosz.AddExpression(posInCubeZ.Value)
Here is an other exemple just to show how to use the pow and fit methods :
import xsi_expr
from xsi_expr import Expression
xsi = Application
#Lets build two nulls
If you are not exhausted by this post, you can try the module on your own here.
Happy scripting !
Cheers
Guillaume Laforge
Categories: dev · programming · xsi
If you often need to apply some expressions on xsi parameters through scripting, maybe you will find this python class usefull…
Expressions are fast to compute and relatively easy to write from the xsi expression editor…but , as I often write expressions from a script, I often lost too much time debugging my concatenation errors. For example if you need to apply an expression from a script , it could look like this pseudo code :
As you can see, writing a simple distance expression between two objects is not fun. It is obvious that it is much more difficult to apply some
formula on strings than on vectors for example. So I create the Expression object. From this object, you can call methods with the same name than the corresponding expression. Here is a little sample :
I recently wrote this class in python just for my needs, and so I added the expression methods “on the fly”. Now, the idea is to put the python source on my blog. If you find this module usefull and if you add your
own expression to the methods, please send me the update ! Maybe next time I will need your expression
.
So here is the python module to define the Expression Object. If you are not using python for your xsi scripts, you can put my class in a python command and call it from your vbs/js scripts.
More info here : http://softimage.wiki.softimage.com/index.php/Python_(XSISDK)#Creating_your_own_Modules
Now it is late, I will continue this post later to show you other examples of this python class. See you soon !
Categories: programming · xsi
In my learning of Cpp, I found an interesting link about the Google C++ Style Guide.
I think there are very good advices for every programmer levels.
Categories: programming