On 24/02/2015 at 01:25, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 16
Platform: Windows ;
Language(s) : C++ ;
---------
Hello there,
we need to update our Export plugin for Cinema 4D 16. This version
introduced the new Reflectance channel's API. We can get the list of
reflection layers and we can also get the color of a relfection layer, but
we cannot get the texture name of the layer. I am sure its just a small
piece of code, but we just can't get it to work.
Material *mat = ... a valid c4d material pointer
const int reflection_layer_count = mat->GetReflectionLayerCount();
for ( int i=0; i < reflection_layer_count; ++i )
{
auto *reflection_layer = matt->GetReflectionLayerIndex( i );
auto reflection_layer_data_id = reflection_layer->GetDataID();
auto *material_data = mat->GetDataInstance();
// this works fine and returns us the color of the reflection layer
auto color = material_data->GetVector( reflection_layer_data_id + REFLECTION_LAYER_COLOR_COLOR );
// so how do we get the texture name? the following code doesn't work
auto *base_link = material_data->GetBaseLink( reflection_layer_data_id + REFLECTION_LAYER_COLOR_TEXTURE );
auto container = base_link->GetLink( base_document )->GetData();
String fn = container.GetString( BASECHANNEL_TEXTURE, "" );
}
Any help would be appreciated.
Note: We do not want to use the old way of getting these properties.