Saturday, December 4, 2010

Setting And Getting Custom Attributes In Softimage ICE

Custom Attributes are very similar to variables in programming.  In Javascript, you might have something like:
height = 72;

In ICE, you connect a SetData node into your ICE Tree.  Open up the node and in the text box, type self.height.  Now the SetData node knows what you want to call your custom attribute, but it doesn't know what type of data it is.  Connecting a Scalar node of 72 into the SetData node will then change self.height into a scalar value of 72.



In the following example, I am creating a particle at position 0,0,0.  I then use a SetData node to define a couple of properties of my particle, making it easier to see what's going on (self.size (1.5) and self.shape (box)).  Next I create a custom attribute called self.my_custom_color and add a color value as it's input.  Lastly, I access the custom attribute via a GetData node with self.my_custom_color and use that to define the particle color.  To access the custom attributes, after you type self. you can hit the Explorer button, open up Point Cloud, and then see a list of all the attributes defined for the object.


Hopefully these two simple examples will help illustrate how to utilize Custom Attributes in your ICE Tree.  Going even further, you can create a custom attribute in one ICE Tree, and then access that data in an entirely different ICE Tree.

3 comments:

  1. I love the tutorial and the blog :) I understand much more, thanks to that tutorial.

    I don't understand is the 'nbpoints' etc custom attributes. The manual does explain it but I'm still quite rough on it, an explanation of 1-2 of those custom attributes could help for me to understand all of them. Of course matrices tutorials, maybe what those Math nodes do and how they work like Multiply by scalar if you can make a tutorial that mixes most.

    Thank You

    ReplyDelete
  2. Thanks for the comment! Glad it has helped.

    nbpoints is not a custom attribute; it's prebuilt. Since you didn't create it, it's not custom. :)

    Guillaume Laforge has a picture on his blog demonstrating how to use that: http://frenchdog.files.wordpress.com/2010/03/buildarrayfromperpointdata1.jpg From this post: http://frenchdog.wordpress.com/2010/03/27/polygon-islands-using-arrays/

    On a side note, I think it's great to hear that Autodesk has hired Guillaume to help develop ""possible" new geometry system" via ICE!

    ReplyDelete
  3. Thanks for the link, I hope to break down and understand arrays while learning Matrix, brain overload :) People should use your blog as a starting point in ICE !

    ReplyDelete