{"id":230,"date":"2009-07-18T11:51:30","date_gmt":"2009-07-18T10:51:30","guid":{"rendered":"http:\/\/www.holyfingers.co.uk\/main\/?p=230"},"modified":"2015-03-22T20:22:18","modified_gmt":"2015-03-22T20:22:18","slug":"softimage-ice-basics-a-simple-emitter-from-scratch","status":"publish","type":"post","link":"https:\/\/www.holyfingers.co.uk\/main\/blog\/2009\/07\/18\/softimage-ice-basics-a-simple-emitter-from-scratch\/","title":{"rendered":"Softimage ICE Basics: A simple emitter from scratch&#8230;"},"content":{"rendered":"<p>I&#8217;ve recently started using ICE pretty regularly at work, nothing too complicated so far, mostly for controlling groups of instanced geometry like soap bubbles floating through the air and lines of marching ants. With the ants especially It became apparent that the default emitters had a couple of interesting &#8220;features&#8221; that would cause problems, getting a predictable, steady, stream of particles to come out at say, 1 per second, for example, was much more difficult than anticipated. So with some digging around and a point in the right direction from one of the many nice folk at <a href=\"http:\/\/www.xsibase.com\/forum\/index.php?board=34;action=display;threadid=39550\" target=\"_blank\">XSI Base<\/a>, I set about making my own emitter from scratch. Since at the time I couldn&#8217;t find any tutorials that explained the process from start to finish (although <a href=\"http:\/\/withanar.blogspot.com\/2009\/03\/introductionthe-supplied-factory.html\" target=\"_blank\">this<\/a> was very helpful) I thought I&#8217;d write up my own. The following tutorial assumes you know Softimage and that you&#8217;ve perhaps had a poke around in ICE without delving in too far, it sets out to take you from an empty pointcloud to a simple particle emitter compound you can export and use again.<!--more--><\/p>\n<p>First things first, open yourself up a nice new scene and create an empty Point Cloud.<\/p>\n<ul>\n<li><em>Get &gt; Primitive &gt; Point Cloud &gt; Empty<\/em><\/li>\n<\/ul>\n<p>With this still selected, pressing <em>Alt-9<\/em> will bring up the ICE Tree, very empty looking at the moment, our pointcloud needs a few basic things before we get started.<\/p>\n<ul>\n<li><em>Create\u00a0 &gt; Simulated Ice Tree<\/em><\/li>\n<\/ul>\n<p>If you&#8217;re not familiar at all with ICE, the little green square that has just appeared is an <strong>ICETree<\/strong> node and all attributes and systems that you set up will be made from similar nodes and compounds thereof and they all have to come through this little chap. Next, as we are going to want our particles to move around, we need a simulation node. ICE has a few hundred different nodes to pick from, all arranged in sections on the left of the ICE Tree window, you can click through the different menus to find the particular node your after but a much quicker way is to use the search bar at the top which will update and narrow down all the nodes you can select from as you type.<\/p>\n<ul>\n<li>The node we&#8217;re looking for is called <strong>Simulate Particles<\/strong>. Once you&#8217;ve found it drag it into the ICETree.<\/li>\n<li>Drag connect from <strong>Simulate Particles<\/strong><em>.Simulate<\/em> -to-<strong> ICETree<em>.<\/em><\/strong><em>New (Port1)<\/em><\/li>\n<\/ul>\n<p>The <strong>ICETree<\/strong> node will expand to accommodate as many Ports as you need, either like you&#8217;ve just done by plugging a node into a <em>New (port#)<\/em> or by right clicking an existing one and selecting <em>Insert Port Before<\/em> or <em>Insert Port After<\/em>, although not always strictly necessary it&#8217;s good practice to keep your <strong>Simulate<\/strong> node to the bottom. Now we have the basics in place we need a few more nodes to create the particles themselves.<\/p>\n<ul>\n<li>Drag a <strong>3d Vector<\/strong>, an<strong> Add Point<\/strong>, an<strong> Every Nth Frame<\/strong>, a<strong> Set Data<\/strong>, and an<strong> If <\/strong>node into the ICETree.<\/li>\n<\/ul>\n<p>Your tree should look something like this:<\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" src=\"https:\/\/www.holyfingers.co.uk\/main\/wp-content\/media\/ICETree1.jpg\" alt=\"\" width=\"648\" \/><\/p>\n<p>Some of these nodes have self explanatory names, others not so much, the first important one is the <strong>Add Point<\/strong>, which adds points in a continuous stream (in this case points are just another name for particles). It also provides ports for control over where they appear <em>(Positions#)<\/em> and what happens every time one is created <em>(On Creation#). <\/em>For starters we can use the <strong>3D Vector<\/strong> node to dictate where our particles are going to emit from.<\/p>\n<ul>\n<li>Drag connect from <strong>3D Vector<\/strong>.<em>Result<\/em> -to- <strong>Add Point<\/strong>.<em>Positions1<\/em><\/li>\n<li>Drag connect from <strong>Add Point<\/strong><em>.Add<\/em> -to- <strong>ICETree<\/strong>.<em>Port1<\/em><\/li>\n<\/ul>\n<p>At this stage if you play your timeline you&#8217;ll see a little dot. Hooray! It lives! Just like you asked, a stream of points is being added at the 3D vector &lt;0, 0, 0&gt;, the origin of the scene. If you want you can double click the <strong>3D Vector<\/strong> node and input your own values, playing back the timeline from the start will result in the points being added at the new position instead. Dots are all well and good, but for something a little more interesting we can use the <strong>Set Data<\/strong> node to change some attributes. By default the Set Data node has one empty <em>Value<\/em> that it &#8220;sets&#8221; but, just like the <strong>ICETree<\/strong> node, it expands as per your requirements, and can be used to control hundreds of different attributes (There&#8217;s a list <a href=\"http:\/\/softimage.wiki.softimage.com\/index.php\/ICE_Attribute_Reference\" target=\"_blank\">here<\/a>). Nearly everything in ICE is done by Getting and Setting Data. For starters we&#8217;ll be wanting to set<em> Self.PointVelocity<\/em> so our particles will move. ICE uses the same dot syntax as everything else in XSI and in this situation we want our <strong>Set Data<\/strong> node to act on the pointcloud it lives in so we need to make sure <em>Self.<\/em> is at the beginning of our attributes.<\/p>\n<ul>\n<li>Double click the <strong>Set Data <\/strong>node<\/li>\n<li>In the empty text box beside <em>Reference<\/em>, type <em>self<\/em><\/li>\n<li>Click the <em>Explorer<\/em> button, expand<em> Point Cloud<\/em>, select <em>Pointvelocity<\/em>.<\/li>\n<li>Set the <em>self.PointVelocity<\/em> <em>Y <\/em>value to 1<\/li>\n<li>Drag connect <strong>Set Data<\/strong>.<em>Execute<\/em> -to- <strong>Add Point<\/strong>.<em>On Creation1<\/em><\/li>\n<\/ul>\n<p>If you play the timeline from the start again we can now see a constant stream of dots moving up in Y from our 3D vector. The attributes we are setting with the Set Data node are being set per particle on their creation, hence using the <em>On Creation<\/em> port on the <strong>Add Point<\/strong> node. At this stage you can add whatever other attributes you might need for your cloud.<\/p>\n<ul>\n<li>Right click on <strong>Set Data<\/strong>.<em>self.PointVelocity<\/em>, select <em>Insert Port Before<\/em> or <em>After <\/em><\/li>\n<li>Follow the steps as for <em>self.PointVelocity<\/em> only pick the different attributes you require, common ones include <em>Color<\/em>, <em>Shape<\/em>, <em>Size<\/em> and, if you&#8217;re going to be using forces, <em>Mass<\/em>.<\/li>\n<li>For each new attribute you&#8217;ll need to insert a new port.<\/li>\n<\/ul>\n<p>You&#8217;ll notice different attributes open up their own respective options within the <strong>Set Data<\/strong> node, handy. Your ICETree should now resemble this:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.holyfingers.co.uk\/blog\/wp-content\/gallery\/gallery\/Sketchbook_1.jpg\"><img decoding=\"async\" src=\"https:\/\/www.holyfingers.co.uk\/main\/wp-content\/media\/ICETree2.jpg\" alt=\"\" width=\"648\" \/><\/a><\/p>\n<p>Currently all our particles are being added in a continuous stream every frame by the <strong>Add Point<\/strong> node, we can impose some control on this using our other two remaining nodes, the <strong>Every Nth Frame<\/strong> and the <strong>If<\/strong>. The <strong>If <\/strong>node provides us with the means to define a <em>Condition<\/em> and two ports to execute in the event this condition is met or not; <em>If True<\/em> and <em>If False<\/em> respectively. In this case <strong>Every Nth Frame<\/strong> will be our condition, essentially every certain number of frames <em>(N)<\/em> the condition will be true and we can tell the <strong>Add Point<\/strong> node to do its thing, otherwise to sit still and do nothing.<\/p>\n<ul>\n<li>Disconnect <strong>Add Point<\/strong>.<em>Add<\/em> -from- <strong>ICETree<\/strong>.<em>Port1 <\/em><\/li>\n<li>Drag connect <strong>Add Point<\/strong>.Add -to- <strong>If<\/strong>.<em>If True<\/em><\/li>\n<li>Drag connect <strong>Every Nth Frame<\/strong>.<em>Result<\/em> -to- <strong>If<\/strong>.<em>Condition<\/em><\/li>\n<li>Drag connect <strong>If<\/strong>.<em>Result<\/em> -to- <strong>ICETree<\/strong>.<em>Port1<\/em><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.holyfingers.co.uk\/main\/wp-content\/media\/ICETree3.jpg\"><img decoding=\"async\" src=\"https:\/\/www.holyfingers.co.uk\/main\/wp-content\/media\/ICETree3.jpg\" alt=\"\" width=\"648\" \/><\/a><\/p>\n<p>The default value for <em>N<\/em> is 9 so if you play your timeline from the start you will see that a particle is now emitted once every 9th frame. At this stage our cloud is pretty much finished, we have control over all the attributes of the particles emitted like size and shape and color, where they are emitted from and how often. If you&#8217;re planning on using this emitter again or sharing it with someone else however, it could do with a bit of tidying up. This is where compounds are very useful, they allow us to wrap up multiple nodes within one single node and export them.<\/p>\n<ul>\n<li>Select everything except the <strong>ICETree<\/strong> and the <strong>Simulate Particles<\/strong> nodes<\/li>\n<li>From the top menu bar select <em>Compounds &gt; Create Compound<\/em><\/li>\n<li>Right click the new <strong>CompoundNode, <\/strong>select <em>Compound Properties<\/em><\/li>\n<li>Give your new compound a name eg. <em>Simple Emitter<\/em>.<\/li>\n<\/ul>\n<p>At the moment all our settings are hidden away inside our new <strong>SimpleEmitter<\/strong> node, and this can be exported for use again as is, for even more handiness though, we can choose to expose some settings so attributes can be changed without having to open up the compound every time. To start with we&#8217;ll expose the <em>N Value<\/em> of the <strong>Every Nth Frame<\/strong> node and give it a friendlier name.<\/p>\n<ul>\n<li>Right click the <strong>Simple Emitter<\/strong> node, select Edit Compound<\/li>\n<li>Drag connect the <em>Expose Input <\/em>port -to- <strong>Every Nth Frame<\/strong>.<em>N Value<\/em><\/li>\n<li>Right click on the newly created <em>N Value <\/em>port on the left and select <em>Rename<\/em><\/li>\n<li>Name your port eg. Emit Every Frame<\/li>\n<li>Close the compound with the X in the top left.<\/li>\n<\/ul>\n<p>Now when you double click the <strong>Simple Emitter<\/strong> compound you can change the custom attribute <em>Emit Every Frame<\/em> with its own little slider. You can repeat these steps for the <strong>3D Vector.<\/strong><em>Value<\/em> and the attributes on the <strong>Set Data<\/strong> node, giving each of them names of your choice, you should end up with something like this:<\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" src=\"https:\/\/www.holyfingers.co.uk\/main\/wp-content\/media\/Compound1.jpg\" alt=\"\" width=\"648\" \/><\/p>\n<p>Notice how much easier it is to read the <strong>Simple Emitter<\/strong> menu with everything in one place and all those exposed references hidden. You might also notice I took the opportunity to spell Colour correctly. \ud83d\ude09<\/p>\n<p>Well that&#8217;s it for now, my first tutorial, I did say it was pretty basic, but I hope someone out there finds it in some way helpful. Crits and comments welcome.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve recently started using ICE pretty regularly at work, nothing too complicated so far, mostly for controlling groups of instanced geometry like soap bubbles floating through the air and lines of marching ants. With the ants especially It became apparent that the default emitters had a couple of interesting &#8220;features&#8221; that would cause problems, getting &#8230; <a title=\"Softimage ICE Basics: A simple emitter from scratch&#8230;\" class=\"read-more\" href=\"https:\/\/www.holyfingers.co.uk\/main\/blog\/2009\/07\/18\/softimage-ice-basics-a-simple-emitter-from-scratch\/\" aria-label=\"Read more about Softimage ICE Basics: A simple emitter from scratch&#8230;\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":2601,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[12],"tags":[43,18],"class_list":["post-230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-3d","tag-softimage"],"_links":{"self":[{"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":62,"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":3944,"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/posts\/230\/revisions\/3944"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/media\/2601"}],"wp:attachment":[{"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.holyfingers.co.uk\/main\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}