View Full Version : weightmap cache
Tekano
08-20-2008, 06:28 AM
hello, just trying to (unsuccessfully) string some nodes together and was wondering out loud if its possible to set data to a custom value - 'my_weights' then add this to the icecache attributes and save a cache files of animated weight maps? Obviously I would have to read this data value from the cache and then reapply this to the weight_map. is this possible?
cheers
grahamef
08-20-2008, 11:48 AM
It should be possible. I haven't specifically tried to cache weightmaps but in theory anything can be cached.
Tekano
08-20-2008, 11:59 AM
thanks Grahamef (chasing you on the other list as well) I have got as far as
1. ICE tree set data custom attribute
1. In simulated Ice tree get weight map data > set data on custom attribute
2. save pointposition and custom attribute to cache file
3. In simulated ice tree, read from cache file the point positions & custom attribute
4. apply custom attribute to value in an empty weightmap.
nothing happens. the points move ok , but no weight map values are set. how do I read a custom attribute from a cache file?
cheers
grahamef
08-20-2008, 01:05 PM
ICE is pretty relentless about optimization so it's possible that if you don't actually use your custom attribute to modify anything visible in the scene, then it doesn't get calculated.
You can fool ICE by using the attribute to set the weightmap values after setting them from the weightmap values.
I've got it almost working over here. The weights get set but it's not updating every frame. I'll check with the devs to see what's up.
grahamef
08-20-2008, 01:35 PM
I figured it out. The tree that reads from the cache file needs to be in the Simulation region.
Have you got it working on your end yet?
Tekano
08-20-2008, 03:58 PM
Thanks Grahame,
Ive tried setting the value to an empty weight map and I also have the tree that reads the data into custom attribute already in the simulation region. its obviously my tree making skills that are at fault. Will post a jpeg up of where im at later.
grahamef
08-20-2008, 05:20 PM
Here're my scenes. You'll need to turn to set the Cache on File node in the wmap_cache_write scene to write to file and play it first.
Tekano
08-21-2008, 10:00 AM
Grahame, that works a treat! my idea was correct - was missing tree etiquette to make it work.
I didnt have the get self outname piped to all the get / set data innames like your tree example
my custom attribute was coloured brown and not black like yours. don't know what that implies or how I did it.
I had the save to cache tree in the simulation region, which didnt seem to help.
I couldnt connect my custom attribute to the empty weightmap data without it going red (again my faulty tree logic, see pic)
seeing it working and how the tree connects together (properly) is certainly helping my tree building out.
many, many thanks
grahamef
08-21-2008, 11:26 AM
I think the problem in your tree is that the Set Data should be referring to "self.cls.clustername.wmapname.Weights". It looks like yours is missing "cls" and the cluster name.
Plugging the outname Get Data "Self" into all the other inname ports is just a habit I'm trying to force myself into. It makes changing references really easy later on.
Having the tree that writes the cache in the Simulation region shouldn't make much of a difference in this situation. I just used the Modeling region because there isn't any need for the results to be based on the previous frame.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.