This adds a new Method to Sketchup's Layer Class
layer.color= arg
where 'arg' is used in several ways.
Usage of 'arg':
as a 3 Integer Array [red, greeen, blue]
layer.color=[255, 0, 0] - e.g. == 'Red'
as a Sketchup::Material
layer.color=material
as a built-in Color, by name
layer.color="Blue"
as a Model.material, by name
layer.color="Brick1"
Limitations:
Can't change the Color for the default Layer=nil, e.g. 'Layer0':
you must change Color manually.
Won't include the Texture-image from a textured Material -
only its Color is used: you must add a Texture manually.
v1.0 20090809
v1.1 20090819 Any Attribute Dictionaries copied to re-colored Layer.
v1.2 20090821 Error with attrdicts==nil fixed
v1.3 20100707 Typo with attrdicts fixed.
...
[Code] layer-color= v1.2
7 posts
• Page 1 of 1
[Code] layer-color= v1.2Last edited by TIG on Fri Aug 21, 2009 9:38 am, edited 1 time in total.
TIG
Re: [Code] layer-color= v1.2A word of explanation, please. Hard to believe the size of what sounds so simple. The dxf string?
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.
Re: [Code] layer-color= v1.2
It was the only way I could get something to work !!! I could have written a shorter dxf string but just used one I exported from CAD as it was quicker... Last edited by TIG on Mon Nov 02, 2009 11:36 am, edited 1 time in total.
TIG
Re: [Code] layer-color= v1.2
It is almost like a black-ruby ![]() TIG, is there a way to read layer's material. The API doesn't give such a method. Tomasz Author of Thea Render for SketchUp
Re: [Code] layer-color= v1.2I recently noticed that the colours "randomly" assigned to the layers consist of just a handfull of colours and not really random ones. Which left my model with a bunch of geometry in the same colour.
I have a question on how this plugin (which seems to be the root of resolving my problem) works from the inside. I'm a bit worried on how does it work on heavy models. Does it export everything to a dxf (including geometry) and import it back or does it just export and import empty dxf with layer information!? EDIT I'm also getting an ugly
POST-EDIT Removing the "definition1_" from line 120 seems to have solved the problem. Since it would take me hell long to go through all Jim's script and see if that change affects something else, i'll leave that to him. But it's working fairly good here. ![]()
7 posts
• Page 1 of 1
|
Who is online
Users browsing this forum: No registered users and 7 guests