CGTalk > Software > Autodesk 3ds max
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 06-05-2013, 02:45 PM   #1
Holzi
Frequenter
portfolio
Christian Holz
3D Artist / Medieninformatiker
Stuttgart, Germany
 
Join Date: Sep 2010
Posts: 276
set Object color same as layer color

Hi Guys,

I have a similar problem like this one.
I Import a DWG file and it is colored according to the different autocad layers (so the layers have the correct color). But I as well need them to be on a single layer. However, once I do this, it changes to the color of the layer (because the objects themselves have no color set).
Is there a way to first set the object color the same as the layer color, and after doing so, add them to a single layer.
Anyone got any ideas how to do that (without setting 50 colors by hand)?

best regards,

Christian
 
Old 06-05-2013, 03:16 PM   #2
PiXeL_MoNKeY
Expert
 
PiXeL_MoNKeY's Avatar
Eric Craft
Dallas, USA
 
Join Date: Mar 2002
Posts: 5,662
To set the wirecolor the same as the layer select all objects that you want to get their color from the layer they are on (can be all scene objects at once), Open the Object Properties Dialog, Press the Color Button, and set the By Object/By Layer button to By Layer.

Side Note: All Objects have a wirecolor, it may be set to black or some other color but every object in 3ds max always has a color.

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
Old 06-06-2013, 07:44 AM   #3
Holzi
Frequenter
portfolio
Christian Holz
3D Artist / Medieninformatiker
Stuttgart, Germany
 
Join Date: Sep 2010
Posts: 276
Quote:
Originally Posted by PiXeL_MoNKeY
To set the wirecolor the same as the layer select all objects that you want to get their color from the layer they are on (can be all scene objects at once), Open the Object Properties Dialog, Press the Color Button, and set the By Object/By Layer button to By Layer.

Side Note: All Objects have a wirecolor, it may be set to black or some other color but every object in 3ds max always has a color.

-Eric


but doesn't that just set the properties of whether it displays all objects on one layer in the color of the layer, regardeless of the objects color? Meaning once I add an object (from the red layer) to another layer (green) it turns to the color of the new layer (green in this case)?

What i need is to actually SET the objects color to that of the layer, so once i move it to another layer, it stays red. Know what I mean?

It seems this script does the job more or less: http://www.scriptspot.com/3ds-max/s...recolor-toolbox
 
Old 06-06-2013, 02:53 PM   #4
em3
day dreamer
 
em3's Avatar
portfolio
Dave Tyner
3D Artist
Polyform Media
Denver, United%2BStates
 
Join Date: Jan 2004
Posts: 984
Send a message via Yahoo to em3
I think this is what you want. After the dwg import, select the objects that you'd like to maintain wirecolor, run this script

Code:
col = for o in selection collect #(o,o.wirecolor)


move them to the destination layer (they no longer have to be selected) and run this script

Code:
for c = 1 to col.count do ( col[c][1].wirecolor = col[c][2] )


Alternatively, you could just create a temp material with the color set to that object's wirecolor.

Code:
--change the word 'objects' to 'selection' to run on just the selected objects. for o in objects where o.material == undefined do ( thec = o.wirecolor m=Arch___Design__mi () m.diff_Color = thec o.material = m )
__________________
www.davetyner.com
 
Old 06-07-2013, 01:07 AM   #5
PiXeL_MoNKeY
Expert
 
PiXeL_MoNKeY's Avatar
Eric Craft
Dallas, USA
 
Join Date: Mar 2002
Posts: 5,662
To set all objects to have their wire color matching the layer they are currently on run:
Code:
objects.colorbylayer = false for o in objects do ( o.wirecolor = o.layer.wirecolor )

To only have geometry have its wire color changed run:
Code:
geometry.colorbylayer = false for o in geometry do ( o.wirecolor = o.layer.wirecolor )

To do it by object selection run:
Code:
selection.colorbylayer = false for o in selection do ( o.wirecolor = o.layer.wirecolor )


Basically the first line ensures that the class isn't using the Color By Layer option, and the loop sets the objects wirecolor to match that of the layer they are currently on.

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
Old 06-07-2013, 01:07 AM   #6
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 12:07 PM.


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