Re: does the clamp function in MEL have an equivalent in XSI expressions?

Date : Tue, 4 Oct 2005 08:37:41 -0700
To : XSI(at)Softimage.COM
From : javier <javier.vdp(at)gmail.com>
Subject : Re: does the clamp function in MEL have an equivalent in XSI expressions?
you should be working with scripted ops, expressions are very limited and very 20th century.
why dont you write your own clamp custom function... it is easy as pie.

If you are Using xsi5 go to the Plugin Manger, under File, choose new custom command...
(in xsi4 it was under Application on the pulldown menus)
Call your command Clamp.
Add 3 inputs to the _Init function , minval,maxval,param
In your _Execute function either use the
SetExpr() function to set the _expression_ to your Clamp inputs or use the
AddScriptedOp() function to build a scripted op

voila, you have a Clamp funciton... It should take about 10 minutes for anyone with scriptin experience. You could get fancy to have clamp working on selected parameter, on animated parameters (clamping fcurves frinstance), or popping a property page with the parameters but that is not so bad either.




Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.