About transparent and alpha

I want to export skp format file into osg format file , I think if transparent is used the alpha will be used , but I notice there are two api that one judges whether use transparent and another judges whether use alpha .
I’m confused.
I want to learn more about this.
Thank you .
(I’m learning ,if I’m mistake , just tell me)

A few questions ...

This applies to color usually, … but I’m guessing here as you have provided no context for this statement.

Links to these two API ? Are these Trimble SketchUp APIs ? … or OpenSceneGraph.org APIs ?

It may be easier to export to OBJ format and use the osgconv command line utility.

ADD: There are also OpenSceneGraph plugins for DXF, PLY, FBX and 3DS (and either native export of these formats from SketchUp, or a plugin in the case of PLY.)

Thank you .
To be honest, I’m not sure whether transparent need alpha always, I’m sorry.
The API are SUMaterialIsDrawnTransparent and SUMaterialGetUseOpacity.
I afraid that the SUMaterialIsDrawnTransparent return true and SUMaterialGetUseOpacity return false.
I do this because I was asked to make a osg plugin that export skp into osg, leader think if use obj the result is not very good,but thanks for your advice.
Thanks for your help.

Okay, those are functions of the SketchUp C API.
They return the boolean value of transparency flags for a material object.

That sounds weird to me. @thomthom, what’s the difference between these 2 boolean flags ?

@nmgm1997, What happens if you send true to SUMaterialSetUseOpacity and then set some amount of transparency ( say 0.5 ) with SUMaterialSetOpacity ?

Good question, the documentation SUMaterialIsDrawnTransparent isn’t doing anything more than parroting the function name.

I found this in the source code:

// If the material has a texture with alpha information, then
// draw it transparent

// Otherwise, look at the transparency for the entire material.

// No transparency here.

So if the material has a texture with transparency this should return true. If the material has non-opaque alpha value then this should return true.

SUMaterialGetUseOpacity checks internal boolean flag. From what I can tell it relates to the opacity of the Material itself - ignoring the texture.

If SUMaterialIsDrawnTransparent returns true and SUMaterialGetUseOpacity returns false I could expect that it’s a material where the material alpha is solid, but the texture has transparent pixels.


Can the above explanation be included in the SDK documentation?
(for future generations)


does’t RGBA texture set one and the opacity slider set the other?


I just filed an issue (and quoted Thomas’ above comments) …

1 Like

Thanks for you help.

Thank you.