Frenchdog’s Weblog

New Perrier Commercial

April 26, 2009 · 10 Comments

I was speaking about our last work at la maison in my previous post and here is already a link on youtube !
A lot of 3d fluid simulations in a rather short amount of time (in a fluid dynamic time scale), but I’m really pleased by the work of the la maison crew :) .

→ 10 CommentsCategories: la maison

How to resample curves in Softimage

April 26, 2009 · 3 Comments

Hi,

Its been a long time since my last development post ! I was a “little” bit busy on the last Perrier commercial at la maison. It was a very interesting project and I hope to give you a web link soon !

In this cloudy parisian weekend, I was cleaning … some files on my laptop when I realised that I could send some of my plugins to the web instead of just let them sleep on the hard drive. 

 Here is the first one, a resample operator. As far as I know, you can’t resample curves in Softimage. I like the “resample” SOP in Houdini as you can choose the  number of points or a fixed segment length to resample a curve, so I add the same feature in this Softimage custom operator. It is a win32 dll, but if you want sources for other platforms, you can send me an email !

PS: no picture or video for this plugin, I’m too lazy !

Edit : I just found an old ICE wire dynamic scene to illustrate this plugin ! It is an unfinished project to find an alternative to Houdini wire solver. But as it is greatly improved in Houdini10 , I’m not sure I will finished it…  At least it is a good example for the resampleOp. A point cloud was used to deform a curve by setting curve points position from particles position.

Here is the video : http://www.vol2nuit.fr/guillaume/blog/resample_xsi_curve_op/resample_xsi_curve_op

→ 3 CommentsCategories: xsi

My wife is a photographer.

April 5, 2009 · Leave a Comment

→ Leave a CommentCategories: photography

Render Curve Compound Update.

February 28, 2009 · 2 Comments

The StrandDeform is an attribute used to “extrude”  ICE strands. It was on my to do list to add it in my render curve compound to reduce the number of particles needed to create a curve. But, as I don’t spend too much time in ICE, I never add it. Fortunatly, Ahmidou Lyazidi, a french director at la station animation add this feature and send it too me. He also debug the U array needed to create the strands (since XSI 7.01, the array initialisation doesn’t work exatly the same way than in XSI 7.0).

You can download the Render Curve Compound 1.2 here.

→ 2 CommentsCategories: dev · xsi

Making Waves: The 14 Days of Vincent Laforet

February 13, 2009 · Leave a Comment

Here is what you can do with some little toys like a Red One and a 5D Mark II cameras. You also need to be in Hawaii with a very good surfer…

http://vincentlaforet.smugmug.com/gallery/6961015_exAjb/1/470408047_95AKN/Large

→ Leave a CommentCategories: photography

An Expression Class for the XSI SDK (part 2)

February 12, 2009 · Leave a Comment

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)

#if we need to see an expressions value we can use the
#xsiShow method like this : 
posInCubeX.xsiShow()
# INFO :
#MIN( MAX( inside_cube.kine.local.posx,  - cube.cube.length / 2 )
#, cube.cube.length / 2 )         

#but you can also log a message like this
#xsilog( posInCubeX.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

 

 

A = xsi.ActiveSceneRoot.AddNull(“A”)
B = xsi.ActiveSceneRoot.AddNull(“B”)

#Position x from B is the power of position y from A.
Bposx = Expression()
Bposx.pow(A.posy, 2) 
#Apply the expression
B.posx.AddExpression(Bposx.Value)

#Rotation z from A is drived by rotation z from B
#But it is  ”re-scaled” between 0 and 90 when B rotate between 0 and 360.
Brotz = Expression()
Brotz.fit(A.rotz, 0, 360, 0, 90)
#Apply the expression
B.rotz.AddExpression(Brotz.Value)
             

#Lets see our expression :
xsilog( Brotz.Value )
# INFO :
#cond( A.kine.local.rotz<0, (A.kine.local.rotz/0)
#*0, (A.kine.local.rotz/360)*90 )
#Now try to create this expression without the Expression Object !

 

If you are not exhausted by this post, you can try the module on your own here.

Happy scripting !

Cheers

 

 

Guillaume Laforge

→ Leave a CommentCategories: dev · programming · xsi

An Expression Class for the XSI SDK (part 1)

February 10, 2009 · Leave a Comment

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 :

  • parameterA = ObjectA.aMasterParameter
  • parameterB = ObjectB.aMasterParameter
  • parameterC = ObjectC.aSlaveParameter
  • theExpression = “ctr_dist( “+ParameterA.FullName+”. , “+ParameterB.FullName+”. )”
  • parameterC.AddExpression( theExpression )

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 :

  • parameterA = ObjectA.aMasterParameter
  • parameterB = ObjectB.aMasterParameter
  • parameterC = ObjectC.aSlaveParameter
  • theExpression = Expression()
  • theExpression.ctr_dist(ParameterA , ParameterB )
  • parameterC.AddExpression( theExpression.Value )

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 !

→ Leave a CommentCategories: programming · xsi

Some new RenderChannels Compounds

February 8, 2009 · Leave a Comment

Thanks to Robert Lenz  for those two new compounds  :

misss_Fast_Shader and
mi_Metallic_Paint

Both use the same logic code than the  mia_x RenderChannel compound, so it was really easy to understand their workflow for me ;) .

→ Leave a CommentCategories: xsi

Houdini Renderset V1

January 11, 2009 · Leave a Comment

A Renderset tools update :

I’m using the Render menu now to execute the python scripts. Here is a quick demo here.

 

 

 

 

 

 

I uploaded those scripts to the Houdini Exchange.

Copy the script and otls folders in one of your $HOME  path for example.  if you want to call those python scripts from the render menu, copyalso  the “MainMenuCommon” file into your $HOME path.
If you want to use them from the shelf, you can copy the code from ”new_renderset.py” into the script tab of a new tool.
Same thing for the  ”add_to_renderset.py”.

The otl file is a simple python Object Operator. By default (when you create it)  this object is just a subnet, and so you can add some objects inside without using the HDA mechanism (the “allow editing of contents”) .  I use this object to find all the renderset nodes as their type is “renderset”. The only little problem is that I can’t create a custom icon for this HDA as it turns it into a “real” HDA .

→ Leave a CommentCategories: houdini

Mental Ray reminders

January 5, 2009 · Leave a Comment

set MI_FORCE_OLD_BSP
set MI_FORCE_OLD_BSP=60 10

As long as you:
1) Ensure the "ShapeInstanceTime" attribute is
nowhere to be seen in your ICE graphs.
2) Don't use Irradiance Particles.
3) Don't use stand-ins.

You should be quite ok.

For 1), this means using the "Instance Shape"
node instead of the "Set Instance Geometry"
compound, as I said before.

If still uncertain, use it only when you're
having real problems with BSP2, and can still
follow the aforementioned rules

* particle with instances slow and crashes
Make sure you use the "Instance Shape" node,
rather than the compound, if you can get
away with it. The compound forces the animated
instances on, due to the inclusion of the
"ShapeInstanceTime" attribute inside of it,
which renders all the instances using mental ray
 assemblies.

The old BSP is not exposed in the UI.

Just setting the environment variable will force XSI to use the old BSP with the 
default BSP settings.

You can specify the maximum depth and size :

set MI_FORCE_OLD_BSP=60 10

Note that certain newer mental ray features do not work properly with this setting,
including irradiance particles, assemblies, the ambient occlusion cache, and some final gathering optimizations.

 

Nice poem isn’t it ?

→ Leave a CommentCategories: xsi