I’ve been looking at the ICE SDK as a start to the process of writing custom ICE Nodes in C++. I need to write topology generators, modifiers and deformation nodes. So far all the source code I’ve seen supplied with Softimage only deal with particle clouds or primitive data such as converting integers to scalars. Does anybody have source code for working with the Softimage SDK inside an ICE Node to modify topology/geometry?.....or Kinematics? Example: creating a polygon mesh from scratch, adding/removing subcomponents, dealing with clusters, etc… I ask this partly because the ICE SDK docs say to not use the object model….which leads to the question – how do I do anything?
While also browsing the SDK docs, I saw in the ‘limitations’ section that custom ICE Nodes cannot define reference, location, or execute ports. Since I am very interested in working with locations, does this mean I cannot do queries for locations from inside the ICE Node? Or does it only mean I cannot send/receive locations from other ICE nodes?
Example:
I need to write an ICE Node which takes a polygon mesh and 2 NURBS Surfaces as inputs, and whose output is the deformation of a 2nd polygon mesh. To accomplish this feat requires the use of point Locators to map the relationship between the first polygon mesh’s points relative to the first surface, then re-interpret that information to deform the points of the 2nd polygon mesh in relation to the 2nd surface. You can assume the two polygon meshes and two surfaces have identical topology. I need to write this as a custom ICE node because it is prohibitively expensive to use the factory nodes (too many nodes/workarounds required leading to severe performance degradation).
I’d like to be able to do a point locator query from inside the custom ICE node for performance (and convenience) reasons. Sample code would be a big help.
Anybody?
Matt
That’s what I was afraid of.
I remember your findings from a while ago, which was part of my incentive to pursue this route. 500ms vs. 20ms is quite significant (2500%). In my case it would be the difference between acceptable performance and unacceptable performance.
I’m OK with having to break this down into a small handful of nodes (~10), but I’m not OK with having to use 300 or so as is currently the case.
On the kinematics front, I’d like to compute the local transform of one object relative to another and spit out the result as a 4x4 matrix. That alone would eliminate 50 nodes from the tree for each instance which the functionality is needed. Another node to convert a UV location from non-uniform to uniform parameterized space would eliminate a significant number of nodes too, and that’s really the bottleneck at this point because doing searches and reverse lookups using the factory nodes is quite cumbersome and impractical.
Matt
BTW – the link to the source code is dead.
Matt
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Ahmidou Lyazidi
Sent: Wednesday, May 15, 2013 3:07 AM
I think your assumptions are rather off base, Raff.
I’d be interested in seeing how you remap a non-uniform UV coordinate to uniform space in ICE using your brute force technique. I solved this problem for a traditional operator, but I cannot see how using your methods it can be done in ICE. In fact, I don’t think ICE exposes enough of the right kind of information to make it possible. But since you said you’ve done it, I’d like to see how it’s done. J
The problem:
Given a location described as a normalized UV coordinate in non-uniform parameterized space, find the equivalent location on another NURBS surface as a normalized UV coordinate described in uniform parameterized space.
Test case:
Given 2 NURBS grids with 4 isolines (subdivisions) in U and V. Leave the first surface as a flat plane without deformations, create the 2nd surface by duplicating the first surface and deforming the 2nd surface significantly – translate the 2nd surface away from the world origin so you can see what you’re doing. On the first surface, get the UV Coordinate for the first interior isoline intersection in U and V (should be roughly 0.25, 0.25). Convert that UV coordinate to uniform parameterized space so it finds the same first interior isoline intersection on the 2nd surface. Do it using only factory ICE nodes.
Actual use case: Repeat the test for arbitrary locations when the surfaces are surface meshes comprised of multiple surfaces (or subsurfaces if you prefer)
The main problem here is it takes waaaaaaay too many nodes to get the job done in a practical manner. We need protection against regressions of nodes that seem to occur from release to release. The last thing I want to deal with is debugging an ICE Tree with 300+ nodes because one node in the bunch now clamps incorrectly, returns NaN, or doesn’t handle divide by zero errors correctly (because a bug elsewhere fed it a zero). Finding problems like this in a traditional operator is manageable, but doing so in ICE is torture.
Matt
Yes, computing a local transform between two objects is pretty trivial, but that’s not what I’m doing.
I am finding the nearest location on a NURBS surface from an object. I then build an orthonormal basis at that location, and compute the local transform from the object relative to the orthonormal basis. The issue is with the location on the NURBS surface. There is no convenient way to compute the orthonormal basis because the information returned in the point locator is approximate and based on the control point hull of the surface, not the surface itself. Therefore I’ve had to resort to a workaround of manually constructing the tangent vectors by issuing multiple location searches by minute distances in U and V from the nearest location found on the surface. Problems arise when I get near the edge/boundary of a surface as I must flip my logic around to create vectors pointing the other direction so I can construct the basis. I have accomplished the feat, but not after using waaaaaay more nodes than should be necessary for such a basic task. I would like to package this into a custom ICE node for convenience as the functionality is needed multiple times within the ICE Tree.
The UV to Location and reinterpret nodes both operate in non-uniform parameterized space. They take a given UV coordinate from one surface and remap it to the other surface, but the resulting location is not topologically equivalent. I had to solve this manually in my scripted operator by doing a reverse lookup of the surrounding knots and samples of the location on the first surface, then do a linear interpolation between the equivalent subcomponents on the other surface to find the topologically equivalent location. Works, but is slow, and Softimage occasionally returns NaN when requesting the sample/knot near a boundary/edge.
Using Softimage 2013 SP1 (32 bit)
2013/5/15 Matt Lind <ml...@carbinestudios.com>
well, let's answer the questions first:
1) Does anybody have source code they are willing to share for custom ICE Nodes that deal with topology and/or geometry?
2) Does the lack of reference, location, and execute ports for custom ICE nodes mean I cannot cast a location search from inside an ICE node?
To answer your question:
Imagine two nulls and two NURBS Surfaces. the task is to find the nearest location from the first null to the first surface. At that location, build an orthonormal basis and compute the local transform of the null relative to that basis. Then reconstruct that relationship by applying it to the 2nd null relative to the 2nd surface assuming both surfaces use uniform parameterization, not non-uniform as is the softimage default. Version 2: extend to operate on vertices of polygon meshes instead of nulls. I have a working version, but it is slow and not very stable.
The problem I'm encountering is it simply takes too many factory nodes to be able to work efficiently. Each node has a certain amount of overhead regardless of what it does. Plus, the support for NURBS in ICE is rather abysmal. I have to construct my own orthonormal basis plus implement my own algorithm to convert from non-uniform parameterization to uniform parameterization. Both are doable, but take very many nodes to do it (including support for edge cases) making the whole effort rather clumsy at best. The parameterization conversion is expensive as it involves sorting and searching (while/repeat/counter nodes). When applying the ICE Compound to a polygon mesh with 5,000+ vertices.....it gets the job done, but chugs.
I have a version of this tool written as a scripted operator, and it performs really well because it has better SDK support and the sorting/searching can be better optimized. But one shortcoming of scripted operators is they self-delete if an input goes missing (which often happens on scene load or model import when the content has been modifed externally). This in turn causes content using the operator to malfunction generating bug reports which are sent to artists to fix. Unfortunately most artists weren't around when the content was created years ago, so they have no idea what's wrong, what the expected output is supposed to look like, or how to fix it. Often an asset has to be retired and replaced. This is my motivation for rewriting the tool as a custom ICE node as ICE is much more graceful when it's inputs don't exist - it just turns red and sits patiently until conditions improve. This gives artists a chance to fix the problem without having to sweat the details because they can read the GetData node to see what's missing, then find and repair it. I'm trying to make the content in our pipeline more durable.
So...I'm looking for code samples of how to deal with topology and geometry in ICE. So far I have not found any.
Matt
From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] On Behalf Of Raffaele Fragapane [raffsx...@googlemail.com]
Sent: Tuesday, May 14, 2013 9:00 PM
To: soft...@listproc.autodesk.com
Subject: Re: custom ICENode - questions and request for example source code
Yeah, same hunch here.
Unless the performance expectations are in the multiple characters real-time concurrently, in which case I think neither way is gonna get there usually.
On Wed, May 15, 2013 at 1:04 PM, Ciaran Moloney <moloney...@gmail.com> wrote:
I'm sorta , kinda sure that's a dead end for a custom node. You might be better off optimizing your ICE tree. It doesn't sound like such a complex problem, care to share?
On Wed, May 15, 2013 at 2:41 AM, Matt Lind <ml...@carbinestudios.com> wrote:
I’ve been looking at the ICE SDK as a start to the process of writing custom ICE Nodes in C++. I need to write topology generators, modifiers and deformation nodes. So far all the source code I’ve seen supplied with Softimage only deal with particle clouds or primitive data such as converting integers to scalars. Does anybody have source code for working with the Softimage SDK inside an ICE Node to modify topology/geometry?.....or Kinematics? Example: creating a polygon mesh from scratch, adding/removing subcomponents, dealing with clusters, etc… I ask this partly because the ICE SDK docs say to not use the object model….which leads to the question – how do I do anything?
While also browsing the SDK docs, I saw in the ‘limitations’ section that custom ICE Nodes cannot define reference, location, or execute ports. Since I am very interested in working with locations, does this mean I cannot do queries for locations from inside the ICE Node? Or does it only mean I cannot send/receive locations from other ICE nodes?
Example:
I need to write an ICE Node which takes a polygon mesh and 2 NURBS Surfaces as inputs, and whose output is the deformation of a 2nd polygon mesh. To accomplish this feat requires the use of point Locators to map the relationship between the first polygon mesh’s points relative to the first surface, then re-interpret that information to deform the points of the 2nd polygon mesh in relation to the 2nd surface. You can assume the two polygon meshes and two surfaces have identical topology. I need to write this as a custom ICE node because it is prohibitively expensive to use the factory nodes (too many nodes/workarounds required leading to severe performance degradation).
I’d like to be able to do a point locator query from inside the custom ICE node for performance (and convenience) reasons. Sample code would be a big help.
Anybody?
Matt
2013/5/15 Matt Lind <ml...@carbinestudios.com>
I've been looking at the ICE SDK as a start to the process of writing custom ICE Nodes in C++. I need to write topology generators, modifiers and deformation nodes. So far all the source code I've seen supplied with Softimage only deal with particle clouds or primitive data such as converting integers to scalars. Does anybody have source code for working with the Softimage SDK inside an ICE Node to modify topology/geometry?.....or Kinematics? Example: creating a polygon mesh from scratch, adding/removing subcomponents, dealing with clusters, etc… I ask this partly because the ICE SDK docs say to not use the object model….which leads to the question - how do I do anything?
While also browsing the SDK docs, I saw in the 'limitations' section that custom ICE Nodes cannot define reference, location, or execute ports. Since I am very interested in working with locations, does this mean I cannot do queries for locations from inside the ICE Node? Or does it only mean I cannot send/receive locations from other ICE nodes?
Example:
I need to write an ICE Node which takes a polygon mesh and 2 NURBS Surfaces as inputs, and whose output is the deformation of a 2nd polygon mesh. To accomplish this feat requires the use of point Locators to map the relationship between the first polygon mesh's points relative to the first surface, then re-interpret that information to deform the points of the 2nd polygon mesh in relation to the 2nd surface. You can assume the two polygon meshes and two surfaces have identical topology. I need to write this as a custom ICE node because it is prohibitively expensive to use the factory nodes (too many nodes/workarounds required leading to severe performance degradation).
I'd like to be able to do a point locator query from inside the custom ICE node for performance (and convenience) reasons. Sample code would be a big help.
Anybody?
Matt
olivier jeannel <olivier...@noos.fr> hat am 15. Mai 2013 um 22:31 geschrieben:
olivier jeannel <olivier...@noos.fr> hat am 15. Mai 2013 um 23:02 geschrieben:
What attributes are you setting in your SetData nodes?
Matt
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Grahame Fuller
Sent: Wednesday, May 15, 2013 2:05 PM
To: soft...@listproc.autodesk.com
Subject: RE: custom ICENode - questions and request for example source code
Reinterpret Location does not work well for this case but I seem to be getting good results with UV to Location. See attached pic. (Let me know if you can’t see the attachment.) I tried several values and they all seem good.
Now to find a clever way to store and read the subsurface ID.
gray
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Matt Lind
Sent: Wednesday, May 15, 2013 03:15 PM
To: soft...@listproc.autodesk.com
Subject: RE: custom ICENode - questions and request for example source code
I think your assumptions are rather off base, Raff.
I’d be interested in seeing how you remap a non-uniform UV coordinate to uniform space in ICE using your brute force technique. I solved this problem for a traditional operator, but I cannot see how using your methods it can be done in ICE. In fact, I don’t think ICE exposes enough of the right kind of information to make it possible. But since you said you’ve done it, I’d like to see how it’s done. J
The problem:
Given a location described as a normalized UV coordinate in non-uniform parameterized space, find the equivalent location on another NURBS surface as a normalized UV coordinate described in uniform parameterized space.
Test case:
Given 2 NURBS grids with 4 isolines (subdivisions) in U and V. Leave the first surface as a flat plane without deformations, create the 2nd surface by duplicating the first surface and deforming the 2nd surface significantly – translate the 2nd surface away from the world origin so you can see what you’re doing. On the first surface, get the UV Coordinate for the first interior isoline intersection in U and V (should be roughly 0.25, 0.25). Convert that UV coordinate to uniform parameterized space so it finds the same first interior isoline intersection on the 2nd surface. Do it using only factory ICE nodes.
From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] On Behalf Of Raffaele Fragapane [raffsx...@googlemail.com]
Sent: Tuesday, May 14, 2013 9:00 PM
To: soft...@listproc.autodesk.com
Subject: Re: custom ICENode - questions and request for example source code
Yeah, same hunch here.
Unless the performance expectations are in the multiple characters real-time concurrently, in which case I think neither way is gonna get there usually.
On Wed, May 15, 2013 at 1:04 PM, Ciaran Moloney <moloney...@gmail.com> wrote:
I'm sorta , kinda sure that's a dead end for a custom node. You might be better off optimizing your ICE tree. It doesn't sound like such a complex problem, care to share?
On Wed, May 15, 2013 at 2:41 AM, Matt Lind <ml...@carbinestudios.com> wrote:
I’ve been looking at the ICE SDK as a start to the process of writing custom ICE Nodes in C++. I need to write topology generators, modifiers and deformation nodes. So far all the source code I’ve seen supplied with Softimage only deal with particle clouds or primitive data such as converting integers to scalars. Does anybody have source code for working with the Softimage SDK inside an ICE Node to modify topology/geometry?.....or Kinematics? Example: creating a polygon mesh from scratch, adding/removing subcomponents, dealing with clusters, etc… I ask this partly because the ICE SDK docs say to not use the object model….which leads to the question – how do I do anything?
While also browsing the SDK docs, I saw in the ‘limitations’ section that custom ICE Nodes cannot define reference, location, or execute ports. Since I am very interested in working with locations, does this mean I cannot do queries for locations from inside the ICE Node? Or does it only mean I cannot send/receive locations from other ICE nodes?
Example:
I need to write an ICE Node which takes a polygon mesh and 2 NURBS Surfaces as inputs, and whose output is the deformation of a 2nd polygon mesh. To accomplish this feat requires the use of point Locators to map the relationship between the first polygon mesh’s points relative to the first surface, then re-interpret that information to deform the points of the 2nd polygon mesh in relation to the 2nd surface. You can assume the two polygon meshes and two surfaces have identical topology. I need to write this as a custom ICE node because it is prohibitively expensive to use the factory nodes (too many nodes/workarounds required leading to severe performance degradation).
I’d like to be able to do a point locator query from inside the custom ICE node for performance (and convenience) reasons. Sample code would be a big help.
Anybody?
Matt
--
Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are!
This is ‘a’ use case. There are many others.
I didn’t use the slow approach you describe below. I resorted to an approximation method which involves a reverse lookup to find the nearest NURBS Samples which surround the location on the surface (via a custom binary search on the NURBS Samples collection), then do a barycentric-like computation between those samples to derive the UV coordinate in uniform parameterized space. The process is done in reverse to apply the mapped location to the other surface. This works relatively fast in a scripted operator, but the pitfall is Softimage occasionally returns NaN or undefined when querying the NurbsSamples collection - usually when querying a sample which resides on a boundary edge of the surface, but it’s inconsistent. I have to implement significant error trapping to prevent the operator from crashing Softimage.
Anyway, I cannot use the approximation technique in ICE because ICE does not have the capability to query NurbsSamples in that way. Even if it could, I would have to implement my own binary search and interpolation methods too. That is where the bloat and performance degradation comes from when applied to production use case. This is also a driving reason to write a custom ICE Node as I could cut out the middleman of bloat and cut to the chase.
The main reason for pursuing ICE is to improve durability of our content. Scripted and compiled operators have the pitfall of self-deleting when an input is missing. In the test case, if one of the nulls goes missing, the operator is deleted automatically and any content relying on that operator is now broken. Since the operator may contain metadata specific to it’s application, it may not be possible to reconstruct the effect after the fact. This scenario is very common on scene load or model import when the inputs are referenced models and they have been modified externally. If such a problem arises using an ICE node, it merely complains, turns red, and waits for the user to resolve the situation. The system is still intact which gives the artist the opportunity to put things right – often with a face palm followed by getting latest version of the missing asset from source control - which is preferable over the artists marching into my office asking me to run diagnostics to figure out why his scene is broken only for me to have to dig back into previous versions of the scene to recognize the problem and determine what input is missing.
Matt
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Raffaele Fragapane
Sent: Wednesday, May 15, 2013 4:24 PM
To: soft...@listproc.autodesk.com
Subject: Re: custom ICENode - questions and request for example source code
Matt, is the test case you outlined also your use case?