by AdamB » Mon Feb 01, 2010 12:08 pm
Is there any way of retrieving the Layer material if rendering_options['DisplayColorByLayer'] has been set?
I can't find anything..
Adam
-

AdamB
- LightUp Support

-
- Posts: 936
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
- Operating system: Mac
- SketchUp version: 2014
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by thomthom » Mon Feb 01, 2010 12:31 pm
I've not found any.  Which is really annoying. Layer and Material classes lack of methods, for renaming, deleting and getting layer material is very frustration. Been moaning to Google about this.
-

thomthom
- PluginStore Author

-
- Posts: 19500
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by TIG » Mon Feb 01, 2010 1:50 pm
My layer-color=.rb used a convoluted work around to import a dxf with a new layer of the same name etc colored as required and the old layer deleted. It only copes with color NOT material. You could work this in reverse - export a dxf of a series of faces, each on a layer; then parse the dxf to find each layer and it's color - using a lookup-table you can at least then convert the colors to RGB values - you won't easily get any textures or the material's alpha though ??? It shouldn't be that difficult to simply have a method layer.material or layer.material="red" !!! 
Last edited by TIG on Fri Feb 12, 2010 2:58 pm, edited 1 time in total.
TIG
-

TIG
- Global Moderator
-
- Posts: 20241
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by AdamB » Mon Feb 01, 2010 8:34 pm
OK thanks. So I'm not going mad!
Adam
-

AdamB
- LightUp Support

-
- Posts: 936
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
- Operating system: Mac
- SketchUp version: 2014
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by AdamB » Fri Feb 12, 2010 2:39 pm
Just a little update.
I've written an extension to extract the Layer material by adding an extra method to class Layer. Works great.
The interesting thing is that the Layer Materials all have names too (starting with "Layer_") but they're invisible to the Ruby material list so I can't return a reference to the Ruby material. I have to return the color and/or texture.
When I get a mo, I'll package it up and post it.
Adam
-

AdamB
- LightUp Support

-
- Posts: 936
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
- Operating system: Mac
- SketchUp version: 2014
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by thomthom » Fri Feb 12, 2010 2:49 pm
AdamB wrote:When I get a mo, I'll package it up and post it.
Excellent! But I'm very curious to where to got the info from. the SDK? But how would different plugins wanting to implement this handle this? multiple plugins extending the layer class?
-

thomthom
- PluginStore Author

-
- Posts: 19500
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by AdamB » Fri Feb 12, 2010 2:55 pm
thomthom wrote:But how would different plugins wanting to implement this handle this? multiple plugins extending the layer class?
So I'm simply going to conditionally add some methods if they're not already there. Because I can't return the material in any useful way, I'll collapse the method calling sequence into 1 name. So: Sketchup.active_model.active_layer.material_colorSketchup.active_model.active_layer.material_textureAdam
-

AdamB
- LightUp Support

-
- Posts: 936
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
- Operating system: Mac
- SketchUp version: 2014
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by thomthom » Fri Feb 12, 2010 3:02 pm
And what does the methods return? array of colour values? and for the texture? And is there a way to set the material?
-

thomthom
- PluginStore Author

-
- Posts: 19500
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by AdamB » Sat Feb 13, 2010 3:55 pm
If thats what Sir wants. 
-

AdamB
- LightUp Support

-
- Posts: 936
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
- Operating system: Mac
- SketchUp version: 2014
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by thomthom » Sat Feb 13, 2010 4:11 pm
neat'o! Can I have fries with that?
So, is the voodoo you're using also able to rename materials? (instead of the current workaround of recreating the material with a new one with the new name and replace the material property for all entities in the model?)
-

thomthom
- PluginStore Author

-
- Posts: 19500
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by TIG » Mon Jun 21, 2010 11:07 am
What became of this great idea ???
TIG
-

TIG
- Global Moderator
-
- Posts: 20241
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by Dan Rathbun » Mon Jun 21, 2010 4:26 pm
TIG wrote:What became of this great idea ??? Dittos!Never saw this 3 year old thread. Spent a while yesterday posting a request for this in the API Wishlist forum. Did I cover everything? Any feature I left out?viewtopic.php?f=180&t=13666&p=253272
I'm not here much anymore. But a PM will fire email notifications.
-

Dan Rathbun
- PluginStore Author

-
- Posts: 5051
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2015
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by thomthom » Wed Oct 13, 2010 8:53 pm
bump ?
-

thomthom
- PluginStore Author

-
- Posts: 19500
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by AdamB » Thu Oct 14, 2010 1:53 pm
Had another look at this, this morning.
There doesn't seem to be any way of setting the Layer properties, the COM API just doesn't offer that functionality.
Adam
-

AdamB
- LightUp Support

-
- Posts: 936
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
- Operating system: Mac
- SketchUp version: 2014
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by thomthom » Thu Oct 14, 2010 2:00 pm
 But one can get? The COM API - is it the SkpReader in the SDK?
-

thomthom
- PluginStore Author

-
- Posts: 19500
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by TIG » Sat Feb 26, 2011 5:00 pm
re-bump
TIG
-

TIG
- Global Moderator
-
- Posts: 20241
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by jiminy-billy-bob » Tue May 28, 2013 1:57 pm
So Adam never published this ? So sad 
-

jiminy-billy-bob
- PluginStore Author

-
- Posts: 1641
- Joined: Wed Oct 13, 2010 9:46 pm
- Location: France
- Name: jiminy-billy-bob
- Operating system: Windows
- SketchUp version: 2014
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Intermediate
-
by AdamB » Tue May 28, 2013 6:15 pm
I'm sitting in Provence and it is pissing down! So I pulled the code from the UK and it looks fine (don't even have to build for PowerPC anymore!) - I'll package it up for Mac and Windows next week.
Adam
-

AdamB
- LightUp Support

-
- Posts: 936
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
- Operating system: Mac
- SketchUp version: 2014
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by jiminy-billy-bob » Tue May 28, 2013 7:14 pm
AdamB wrote:So I pulled the code from the UK and it looks fine (don't even have to build for PowerPC anymore!) - I'll package it up for Mac and Windows next week.  Great News ! Thanks a lot ! AdamB wrote:I'm sitting in Provence and it is pissing down!
Too bad, the sun is shining here in Normandie 
-

jiminy-billy-bob
- PluginStore Author

-
- Posts: 1641
- Joined: Wed Oct 13, 2010 9:46 pm
- Location: France
- Name: jiminy-billy-bob
- Operating system: Windows
- SketchUp version: 2014
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Intermediate
-
by thomthom » Tue May 28, 2013 9:50 pm
AdamB wrote:I'm sitting in Provence and it is pissing down! So I pulled the code from the UK and it looks fine (don't even have to build for PowerPC anymore!) - I'll package it up for Mac and Windows next week.
Will it be just the binaries or is there any chance we can see the source - making for a nice small tutorial? ...even though the old C++ SDK is deprecated...
-

thomthom
- PluginStore Author

-
- Posts: 19500
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by jiminy-billy-bob » Sat Jul 06, 2013 8:45 am
Up ?
-

jiminy-billy-bob
- PluginStore Author

-
- Posts: 1641
- Joined: Wed Oct 13, 2010 9:46 pm
- Location: France
- Name: jiminy-billy-bob
- Operating system: Windows
- SketchUp version: 2014
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Intermediate
-
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Developers' Forum
|