Get color of material from sketchup SDK?

Hi, I use sketchup SDK 2013.
I want get: diffuse, specular, selfillumpct, shinstrength of color of material.
please help me.
(Sorry for my english).

You can consider the example of skp2xml.

static XmlMaterialInfo GetMaterialInfo(SUMaterialRef material) {
  assert(!SUIsInvalid(material));

  XmlMaterialInfo info;

  // Name
  info.name_ = GetMaterialName(material);

  // Color
  info.has_color_ = false;
  info.has_alpha_ = false;
  SUMaterialType type;
  SU_CALL(SUMaterialGetType(material, &type));
  // Color
  if ((type == SUMaterialType_Colored) ||
      (type == SUMaterialType_ColorizedTexture)) {
    SUColor color;
    if (SUMaterialGetColor(material, &color) == SU_ERROR_NONE) {
      info.has_color_ = true;
      info.color_ = color;
    }
  }

  // Alpha
  bool has_alpha = false;
  SU_CALL(SUMaterialGetUseOpacity(material, &has_alpha));
  if (has_alpha) {
    double alpha = 0;
    SU_CALL(SUMaterialGetOpacity(material, &alpha));
    info.has_alpha_ = true;
    info.alpha_ = alpha;
  }

Only one color(diffuse) can be get from material.

OK, thank you very much :slight_smile:

And how to get specular, selfillumpct, shinstrength of one face 3d of sketchup file ???

Can we get ??