Script linking display color to label color?

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  08 August 2013
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
  08 August 2013
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:

import c4d

def colorObjects(objects,color):
	for item in objects:	  
		if findIt != None: ## if the object is in the scene..
# 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.

  08 August 2013
I am dumb...

Attributes > Use Color > Layer

Attached Images
File Type: png Screen-Shot-2013-08-21-at-2.18.49-PM.png (10.7 KB, 24 views)
----end of line
  08 August 2013
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 )

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
if __name__=='__main__':

  08 August 2013
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
Society of Digital Artists

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

All times are GMT. The time now is 01:42 AM.

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