CGTalk > Software > Maxon Cinema 4D
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 08-21-2013, 05:04 PM   #1
Navstar
Expert
 
Navstar's Avatar
N Parker
Mograph Dude
Los%2BAngeles, United%2BStates
 
Join Date: May 2007
Posts: 2,108
Script linking display color to label color?

Just because I'm a organizational freak, would there be a way to set the Icon Color checkbox "on" and set the Display Color (Attributes palette -> Basic) to the same color as the Layer Color (Layer palette)?

Is that something scriptable?
__________________
----end of line
 
Old 08-21-2013, 06:44 PM   #2
Horganovski
Freelance Animator/Rigger
 
Horganovski's Avatar
portfolio
Brian Horgan
Graphite9
Dublin, Ireland
 
Join Date: Apr 2007
Posts: 4,877
I'm sure it is, I haven't done a lot with Layers and Python yet, but setting the display color of objects is pretty simple, for example:

Code:
import c4d red=c4d.Vector(1,0,0) green=c4d.Vector(0,1,0) blue=c4d.Vector(0,0,1) def colorObjects(objects,color): for item in objects: findIt=doc.SearchObject(item) if findIt != None: ## if the object is in the scene.. findIt[c4d.ID_BASEOBJECT_USECOLOR]=2 findIt[c4d.ID_BASEOBJECT_COLOR]=color c4d.EventAdd # then run the colorObjects proc sending it the name of the item and a color (vector)

Then you just need to parse the layer for the objects and extract the color info and use those variables in the proc above.

Cheers,
Brian
 
Old 08-21-2013, 09:20 PM   #3
Navstar
Expert
 
Navstar's Avatar
N Parker
Mograph Dude
Los%2BAngeles, United%2BStates
 
Join Date: May 2007
Posts: 2,108
I am dumb...

Attributes > Use Color > Layer

D'oh
Attached Images
File Type: png Screen-Shot-2013-08-21-at-2.18.49-PM.png (10.7 KB, 24 views)
__________________
----end of line
 
Old 08-21-2013, 10:53 PM   #4
Horganovski
Freelance Animator/Rigger
 
Horganovski's Avatar
portfolio
Brian Horgan
Graphite9
Dublin, Ireland
 
Join Date: Apr 2007
Posts: 4,877
D'oh indeed! Glad I didn't spend time trying to get the color of the layer via Python.

You could still script it so that if it's something you do a lot you could have this on an icon button in your UI, then just select the objects and click to set them all to use layer color. 1.42 seconds faster than going to the attributes manager and switching it there.. (no I didn't time it )

Code:
import c4d def main(): objList=doc.GetActiveObjects(True)# get the selected objects for obj in objList: obj[c4d.ID_BASEOBJECT_USECOLOR]=3 # switch on use layer color c4d.EventAdd() if __name__=='__main__': main()


Cheers,
Brian
 
Old 08-21-2013, 10:53 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:28 AM.


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