I think the particle-system operates with chunks of memory and adding user-defined attributes isn't possible (yet?).If the type isn't per-particle as well: could you derive from Particles (Primitive) and add an extra field there? > Date: Thu, 6 Dec 2012 08:48:25 +0800> From: [email protected] > To: [email protected] > Subject: [Nuke-dev] Adding attributes to particles > > So I have this node that adds attributes to geo, specifically "size" and > "type", so that this geo can be rendered as some sort of particles, > downstream. > > This node used to be derived from GeoOp, so geometry_engine() was called > by Nuke and added/modified these attributes. > > But GeoOp being the base had the side effect that particle nodes > wouldn't accept it as an input. So now the node is derived from > ParticleBehavior. The problem is now that geometry_engine() is not > called anymore, when the downstream node is a ParticleOp of some sort. > > Interestingly, geometry_engine() is still called when the node is > directly connected to a Scene (this is probably a bug in Nuke but it is > great because we want this to happen!) > > What I want is a callback, like geometry_engine(), that allows me to > modify/add attributes on the incoming particles. > There is applyBehavior() and I use that successfully for "size" if the > input is particles. But if the input is geo, this doesn't work as the > geo doesn't have any size attribute. Also there seems to be no way to > add custom attributes in applyBehavior(). > > Any suggestions? I tried deriving the node from both bases but this gave > me lots of ambiguity errors that I could never completely get rid of. > I also think it wouldn't solve it because if the downstream node was a > ParticleOp, geometry_engine() wouldn't get called in any case, innit? > > In short: how do I make a node that allows me to add attributes to > particles and which works as an input to Nuke particle nodes? > > .mm > _______________________________________________ > Nuke-dev mailing list > [email protected], http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
_______________________________________________ Nuke-dev mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
