[Ruby doc] .materialType method
-
@unknownuser said:
materialType
The materialType method retrieves the type of the material.
Syntax
type = material.materialType
Return Value
type - the material type for the Material objectThe last line explains everything.
As far as I can tell:0 - just coloured material
1 - textured
2 - texured & colouredA strange thing - when I reset colour of the texture the Type stays 2!!
I am intensively looking for a method that would tell me if a texture on a face is 'projected/photomacthed' or not. This one doesn't seem to do the job
I hope a Google friend will enlighten us or we can somehow figure it out together.
Thanks
Tomasz -
Any clue? I know there are a lot commercial exporters and SU2KT is a great rival
Tomasz
-
@unknownuser said:
...'projected/photomacthed'
Sorry cannot help with that. But it would be great if there is a way to find out it.
-
I'm working on getting an answer for this.
Todd
-
I checked with Google. You are correct, these are the values:
0 = solid
1 = textured
2 = colorized texturedI've updated the doc: http://groups.google.com/group/SketchUp-Plugins-Dev/web/Ruby-Material.html?hl=en#materialType
Todd
-
@unknownuser said:
I am intensively looking for a method that would tell me if a texture on a face is 'projected/photomacthed' or not. This one doesn't seem to do the job
Todd, I'm not quite clear, sorry
Correct me if I'm wrong, I read the post you linked at google groups, but it's apparent to me, (I'm no programmer) then that it's impossible with the methods provided in SU6 to check to see the difference if a material applied in the scene is a photomatched texture or just any old .jpg Texture.
If not, will there be a patch released to provide a method? Or at least can google team please confirm providing this method in SU7
-
@fletch said:
... it's apparent to me, (I'm no programmer) then that it's impossible with the methods provided in SU6 to check to see the difference if a material applied in the scene is a photomatched texture or just any old .jpg Texture.
And you would be correct. There is not Ruby support for Photomatch in V6. I can't speak for V7.
-
It is sad. So maybe SU SDK could help, but it isn't within my abilities to play with it.
def SU2KT;;texture_distorted?(e,mat,mat_dir) distorted=false temp_tw=Sketchup.create_texture_writer model = Sketchup.active_model entities = model.active_entities model.start_operation "Group" #For Undo group=entities.add_group group.material = mat g_handle=temp_tw.load(group) temp_handle=temp_tw.load(e,mat_dir) entities.erase_entities group Sketchup.undo distorted=true if temp_handle!=g_handle temp_tw=nil return distorted end
Here is what I am doing in SU2KT, but it is slow, memory consuming and dirty.
Btw. Todd - have you noticed that .materialType doesn't change from 2 back to 1 if a material is not longer colorized. Am I correct?
Thanks
Tomasz
Advertisement