Face material not set
-
hello.
I created a sketchup importer in c++ for opengl.
I have a problem:
Is possible to know if a face material is not set?
Whitout read his color?
For exemple if i set a texture on a face in front texture , and nothing on back face,is possible to know this "not set" material?
with the c++ sdk.
thanks. -
I'm a little uncertain what it is you are requesting
A face has a face.material and face.back_material methods - these return 'nil' if there is no actual material assigned to these. There are the equivalent face.material=aaa and face.back_material=bbb - where aaa and bbb are the SUp materials or material 'names' - setting face.material=nil etc removes any material it might have, but this is unnecessary on a 'new' face as it already has 'nil' material.
So if you create or 'import' new faces then by default they have no materials assigned to them. You assign materials by reference in your code to a SUp material or by-SKP-material-name (that material must be preexisting) or by-OpenGL-color-name [e.g. 'red'] (that material is auto-made if it doesn't already exist).If you are actually talking about an 'exporter' then you can find the RGB colors of the two default materials in that Style to pass on... or more simply invent two new colors within your code, so the two default materials are consistently made...
Advertisement