Friday, February 24, 2012
Shape blending in ICE using an image sequence
Open the scene Blend_Shape_Using_TextureMap.scn. Select the Can object and from the Get > Property > Texture Map menu choose Texture Map. In the Clip section of the PPG, click the New button and choose New From file from the popup menu. Select the Gradient_Mask.jpg sequence and click OK to load the images. Select the Texture_Projection in the UV Property.
With the Can still selected, press [Alt]+[9] to open an ICE Tree view. From the Create menu choose ICE Tree. Get a Get Data node, open its PPG and enter Self.PointPosition as the Reference. Get another Get Data node, open its PPG and click the Explore button. Expand the Can > Polygon Mesh > Clusters > Can_ShapeKey > Can_ShapeKey branch of the tree and select the positions element. What you want to do is interpolate or blend between the objects current point position and the positions of the shape key. Get a Linear Interpolate node and connect the Value output of Get Self.PointPosition node to its First input.
The shape key does not store the actual point position of the shape, but the points' change in position in relation to the initial mesh. To get the actual positions you need to add the shape to the current point position. Get an Add note and connect the Self.PointPosition to the Value1 input of the Add node and the Get Can.cls.Can_ShapeKey.Can_ShapeKey.positions to the Value2 input. Connect the Result of the Add node to the Second input of the Linear Interpolate node. Get a Set Data node and enter Self.PointPosition as the Reference in the PPG. Connect the Result output of the Linear Interpolate node to the Self.PointPosition input of the Set Data node. Connect the Set Data node to the Port1 input of the ICETree node.
The blend value of the Liner Interpolation node controls how much influence each of 2 input values will have. A value of 0 means the second value of the Linear Interpolation node will have 0 affect which results in the first value having full affect. With the blend value set to 1, the opposite is true and the second input will have full affect and the first input 0. Instead of setting the blend value for the entire mesh at once, you can set it per point based on the RGB value of an image sequence. Get a Get Point Texture Map Color node and a Color to Brightness node. The Color to Brightness node converts the RGB value of the image to a scalar value which in can then be used to control the blending of the Linear Interpolation. Connect the Value output of the Get Point Texture Map Color node to the Color input of the Color to Brightness node. Connect the Brightness output of the Color to Brightness node to the Blend input of the Linear Interpolate node.
The project files used in this tutorial can be found at: http://dl.dropbox.com/u/3834689/CaffeineAbuse/ShapeBlendingWithICE.zip
While you typically want to set the blend value between zero and one, you can use values above 1 to amplify the affect or negative values to inverse it.
Quick tip
If you want to blend between more than 2 shapes you can use the Blend node instead. Note that the blend node will output the weighted sum of all the inputs, so if you increase the weight of one input you'll need to equally decrease the weight of the other inputs to avoid double transformation.
Read the full post>>
Posted by Ola Madsen at 6:10 PM 0 comments
Labels: ICE, Softimage XSI, Tutorial
Friday, January 27, 2012
Turbulize the position of a locator with ICE kinematics
The project files used in this tutorial can be found at:http://dl.dropbox.com/u/3834689/CaffeineAbuse/ICE_Kinematic_Turbulence.zip
Read the full post>>
Posted by Ola Madsen at 5:47 PM 1 comments
Labels: ICE, Softimage XSI, Tutorial
Wednesday, December 28, 2011
Particle sprites using ICE
From the Get > Primitive > Polygon Mesh menu choose Grid. From the Simulate > ICE > Create menu choose Emit Particles from Selection. With the PointCloud selected, press [Alt] + [9] to open an ICE Tree View. Open the Emit from Surface node's PPG and decrease the Rate to 10, set the Shape to Rectangle and the Size to 1. Close the PPG. In order to be able to use different textures for the particles, you need to give each particle an custom attribute telling which texture (or material) to use. Open the Preset Manager View and Get a Randomize Value by Range node. Leave the default values as they are. The Randomize node outputs a scalar value (meaning it also holds decimals) so you need to round the output to the nearest integer. Get a Round node and connect the Value output of the Randomize Value by Range node to the Value input of the Round node. Get a Set Data node, open its PPG and enter Self.SpriteID as the Reference. Connect the Integer output of the Round node to the SelfSpriteID input of the Set Data node. Connect the Set Data node to the Execute on Emit1 input of the Emit from Surface node. Close the ICE Tree View.
Let the animation play for a few frames to emit some particles. With the PointCloud still selected, from the Get > Material menu choose any shader to apply a local material. Press [7] to open an Render Tree. Get an Integer Attribute node and a Color Multi-Switch node. The Color Multi-Switch node enables you to use multiple textures or materials and switch between them based on the integer value specified in the PPG. Connect the Integer Attribute node to the Switch input of the Color Multi-Switch node and the Color Multi-Switch node to the Surface and Shadow input of the Material node. Open the Integer Attribute node's PPG and set the Attribute to SpriteID.
Get an Image node and open its PPG. Click the New button and select the Sprite_Zero.tga image from the projects folder. Close the PPG and get a Sprite node. Connect the Image node to the input of the Sprite node and Sprite Output to the Input0 of the Color Multi-Switch node. The Sprite node will automatically use the alpha channel of the image to define its transparency. Repeat the last step three more times and connect the input1, input 2 and input 3 of the Color Multi-Switch node.
The project files used in this tutorial can be found at: http://dl.dropbox.com/u/3834689/CaffeineAbuse/PatrticleSprite_using_ICE.zip
The technique was early adopted by the games and CGI industry as a cost effective way to give the illusion of 3D by mapping a 2D texture onto a 3D plane.
Quick tip
More often than not you want the sprites to face the camera, aka Billboarding. To do so, open the ICE Tree and get an Align Particle to Camera node. Open its PPG and select the camera you want the sprites to be aligned to and connect the node to the Port2 of the ICETree node.
Read the full post>>
Posted by Ola Madsen at 5:59 PM 0 comments
Labels: ICE, Softimage XSI, Tutorial
Thursday, December 22, 2011
Happy Holidays!
Read the full post>>
Posted by Ola Madsen at 5:22 PM 1 comments
Labels: Blog related
Friday, September 30, 2011
Squash and stretch
One of the most fundamental (and important) rules in animation is the use of squash and stretch which is used to give the illusion of weight and volume as an object moves.Open the scene Ball_Rig.scn. Select the Ball and from the Get > Primitive menu choose Lattice. In the Lattice PPG, change the Subdivision on all three axis’s to 2 and close the PPG. With the Lattice still selected, press [T] to set the selection filter to points and select the top nine points on the lattice. From the Main Command Panel (MCP) > Edit menu choose Create Cluster with Centre. This creates a null object and automatically constrains the selected points to that null, meaning that if you move (or scale) the null the corresponding part of the lattice will move as well. Select the Null and name it Lattice_Cns_Top. Repeat the procedure for the middle and bottom points so you have one null controlling the top, one controlling the middle (name it Lattice_Cns_Center) and one the bottom (name it Lattice_Cns_bottom) part of the lattice.
From the Get > Primitive > Curve menu choose Circle. Name it Squash_Bottom and set the Radius to 2. Rotate the circle -90 degrees along the X-axis and then from the MCP >Transform menu click Freeze Rotation. Duplicate the curve and position it at the centre of the ball (Y:4) and increase the radius to 6 so it extends the edge of ball. Change its name to Squash_Center. Duplicate the bottom curve again, position it at the top of the Ball (Y:8) and change the name to Squash_Top.
Select the Lattice_Cns_Top null and click the Parent button in the MCP. With the middle mouse button, select the Squash_Top curve to make it the parent of the null. Right click to end the picking session. Make the Squash_Center parent of the Lattice_Cns_Center null and the Squash_Bottom parent of the Lattice_Cns_bottom null.
It’s important to remember that the object’s volume is constant and does not change no mater how far you squash or stretch it. As you move the Squash_Top and Squash_Bottom curves closer together the Ball squashes vertically which means you’ll have to compensate the loss of volume by expanding (scaling) it horizontally by the same amount. The diameter of the Ball is 8 units, so when the distance between the top and Bottom curves are 8 units it’s in its “default state” and the scaling should remain at 1. By dividing the distance between the top and bottom curves by the diameter of the ball, you’ll calculate the scaling factor.
Select the null named Lattice_Cns_Top and press [Ctrl]+[K] to open its Local Transform PPG. Right click the animation icon (green divot) next to the X Scaling and choose Set Expression… from the popup menu. In the editing pane of the Expression Editor enter:
8 / ctr_dist( Squash_Top., Squash_Bottom. )
Click the Apply button to apply the expression and close the PPG. You’ll need to apply the same expression to the scaling on the Z axis as well. To copy the animation, right click on the animation icon and choose Copy Animation from the menu. Then right click on the animation icon for the Z axis and choose Paste Animation. Open the Local Transform PPG for the Lattice_Cns_Center and Lattice_Cns_Bottom and paste the animation to their respective X and Z axis.
The project files used in this tutorial can be found at:http://dl.dropbox.com/u/3834689/CaffeineAbuse/Squash_and_stretch.zip
Using a lattice with an extra subdivision in the middle of the sphere enables you to change the object’s center of mass in addition to the overall squash and stretch.Quick tip
The curves should only be used to control the squash and stretch action and not actually move or translate the ball. To do so, create another curve and make it the parent of all the other objects, including the Ball.
Read the full post>>
Posted by Ola Madsen at 6:52 PM 2 comments
Labels: Rigging, Softimage XSI, Tutorial
Thursday, September 15, 2011
Surface constraint and transformation
While constraining an object to a surface as such is a straightforward task and won’t require more than a few mouse clicks, it may still leave you with a sensation of not being quite satisfied. Once you add the constraint you loose the option to freely move the object with the standard translate tool and are left with two (somewhat less intuitive) sliders within a PPG. By adding an extra dummy object to the mix, you’ll effectively manage to get the most out of both approaches.
The project files used in this tutorial can be found at:http://dl.dropbox.com/u/3834689/CaffeineAbuse/Surface_cns.zip
Add Surface Constraint
Start by position the Null object in the lower right corner of the Surface (X:-4, Y:0 Z:4). Select the Box and click the Constrain button in the Main Command Panel and choose Surface (Param) from the menu. Pick the Surface when prompted. In the Surface Cns PPG click the Lock icon to pin it to the screen. Activate both the Tangency and the Normal by checking the checkbox under there respective tab. Return to the Surface tab. Make sure both the U and V Location are set to 0 [zero]. Right click on the U Location’s animation icon (the green divot) and choose Link with… from the menu to open the Parameter Connection Editor.
Link the parameters
In a viewport, select the Null object and (if neeed) then click the Refresh button for the Driving Source to update the explorer. The Driving Source is the object used to control or drive the parameter whereas the Driven target is the parameter that will end up being affected. Click the Driven Target button in the menu and change the Filter to All Nodes to display the proper parameters. In the Target explorer, expand the kine.Constraints node and select the surfcns.posu parameter. Select the posx parameter in the Driving Source explorer. Click the Link button to create the connection and the Set Relative Value button.
Change the interpolation
Move the Null object to the Surface’s lower right corner and change the U Location value to 1 in the Surface Cns PPG. Click the Set Relative Values button in Parameter Connection Editor. Continue by selecting the surfcns.posv and the Nulls posy parameter. Click Link button followed by the Set Relative Value. Position the Null in the upper right corner of the Surface. Change the V Location in the Surface Cns PPG to 1 and set a new Relative Value. Select the Box and click 0 [zero] to open an Animation Editor. Select the Fcurves for the surfcns.posu and surfcns.posv and from the Curves menu choose Linear Interpolation. Move the Null to translate the Box over the surface.
Read the full post>>
Posted by Ola Madsen at 6:18 PM 4 comments
Labels: Rigging, Softimage XSI, Tutorial
Monday, August 15, 2011
Frame number as 3D text
From the Create > Text menu choose Solid Mesh. Unlike most other parameters in Softimage, the editing pane does not come with an animation icon and as such it does not offer a direct way to animate or control via expression. However, this certainly does not mean it can’t be done. You’ll return to the PPG in a second, but close it for now. There’s a slight difference between the standard primitives in Softimage and the text object. While the standard primitives creates a single object the text operator instantly renders your input text as curves which are then converted to a 3d object using the convert curves to mesh command. As such, it automatically creates two new objects; the text object which is the converted curves and the polymsh object which in turn is the 3d conversion of the curves. If you haven’t done so already, press [8] to open an Explorer. Click on the (+) sign next to the Text node and expand the NURBS Curve List > Text To Curve Converter. Right-click on the Text node and choose Set Scripted Operator… from the popup menu. Scripted operators are a bit like expressions on steroids and enable you to bring scripting into play to control parameters in your scene.In order to print the current frame you first need to extract that particular information from the scene. This is done with the In_UpdateContext.CurrentFrame property. The next step is to apply this value to a parameter, namely the input used to create the curves of the text object.
In the top editing pane, enter
oCurrFrame = In_UpdateContext.CurrentFrame
Out.Value.Parameters("text").Value =oCurrFrame
Press the Apply button to apply the operator and then close the PPG. Your text object will now display your current frame as 3d object. If you scrub the timeline you’ll notice a slight inaccuracy. The current frame does not get updated. By default the scripted operator will only update if the input or parameter is changed. In the Explorer, expand the Text tree to display the Script Op node and click on the S icon to open the PPG. Check the AlwaysEvaluate checkbox and close the PPG.
Select the polymsh object and press [Ctrl] + [End] to open the last operator in the stack (the Curve To Mesh PPG). By default the size of the text is set to an absolute size in Softimage units which will cause a slight jitter when you playback the animation. In the Text To Curve_Converter section, change the Text vs Font Size Method to Ratio: Points per Softimage Unit. Close the PPG and you’re done.
The project files used in this tutorial can be found at:http://dl.dropbox.com/u/3834689/CaffeineAbuse/Scripted_Text_Operator.zip
Quick tip
If you’re using an earlier version of Softimage the In_UpdateContext.CurrentFrame property may not function. If so simply replace it with GetValue("PlayControl.Current")
Read the full post>>
Posted by Ola Madsen at 6:40 PM 0 comments
Labels: Scripting, Softimage XSI, Tutorial





