refs.dependents usage?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  04 April 2010
refs.dependents usage?

Hi I have a point3Script controller assigned to the diffuse color of a material. I want to be able to access the cylinder that this material is assigned to so that I can change the color of the material based on the height of the cylinder that it's assigned to. I'm going to be making a bunch of these cylinders each with their own uniquely named material. So no worry about the material being assigned to more than one object. The way that I have working right now is doing the job, but I can't help think there would be a more elegant way to go about it than this. Can anyone help?


  daDependents = (refs.dependents this)
  disObjects = for ref in daDependents where (superClassOf ref == GeometryClass) collect ( ref )
  disObject = disObjects[1]
  



Cheers,
Cg.
__________________
Not bad. For a hughman.
 
  04 April 2010
Originally Posted by 3rd Dimentia: Hi I have a point3Script controller assigned to the diffuse color of a material. I want to be able to access the cylinder that this material is assigned to so that I can change the color of the material based on the height of the cylinder that it's assigned to. I'm going to be making a bunch of these cylinders each with their own uniquely named material. So no worry about the material being assigned to more than one object. The way that I have working right now is doing the job, but I can't help think there would be a more elegant way to go about it than this. Can anyone help?


   daDependents = (refs.dependents this)
   disObjects = for ref in daDependents where (superClassOf ref == GeometryClass) collect ( ref )
   disObject = disObjects[1]
   



Cheers,
Cg.



-- if this is the material
theNode = refs.dependentNodes this firstOnly:on
 
  04 April 2010
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:32 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.