Sunday, 18 November 2012

More Even Spacing













Softimage 2012 gave us the ability to create ICE Attributes directly via scripting and populate them with data. Guillaume Laforge used this ability extensively in CrowdFX and I've recently been using it as a mechanism to easily store large datasets in place of Blobs (e.g. for storing animated curve data from Flame GMasks).

As a simple example, I created a script which takes an input curve and creates an ICE Attribute on that curve containing evenly-spaced point positions. The relationship is 'live' so you can manipulate the curve and alter the number of evenly spaced 'ICE' points. You could then go on to feed that ICE data into another ICE tree.

In the same archive I've also included a script to generate a 'real' curve with a live link to the original curve - the new curve has evenly spaced points* and can be any degree you choose and/or constrained to the original. (*This even spacing becomes more accurate the higher your resolution).

The archive is here.

6 comments:

  1. Hey Julian, good to see you posting again!
    thanks for sharing the scripts.

    ReplyDelete
  2. Thanks Fabricio. Hope you find them useful in some way and, btw, thanks very much for all yours!

    ReplyDelete
  3. Hello Julian.
    Thanks a lot, it was very helpful.

    As far as I understand you are getting this evenly-spaced points using EvaluatePosition function. The closest analogy of it in ICE is node "UV to location" but this node return not-so-evenly distributed points =( Is there any way to create ICE-node wrapping your script inside? It would be much easier to plug such node in ice tree and not to run script every time you need it.

    ReplyDelete
  4. danil - isn't this what you're looking for:

    http://julianjohnsonsblog.blogspot.co.uk/2010/07/even-spacing-on-curvenormalised-u-on.html

    ReplyDelete
    Replies
    1. Oh, thanks, I didn`t notice that post. Yes, it solves my task but ICE version seems to be so much slower compared to your Python version(I need 500-1000 samples along curve). I don`t understand why they wouldn`t made ICE analog of EvaluatePosition function if they had it "under the hood" anyway.

      Delete
  5. Thank's a lot ! Using it atm !

    ReplyDelete