Cycles: Add XML parsing of MappingNodes to Cycles Standalone
Reviewers: dingto, sergey Differential Revision: https://developer.blender.org/D2009
This commit is contained in:
@@ -30,6 +30,46 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Texture Mapping */
|
||||
|
||||
static ShaderEnum texture_mapping_type_init()
|
||||
{
|
||||
ShaderEnum enm;
|
||||
|
||||
enm.insert("Point", TextureMapping::POINT);
|
||||
enm.insert("Texture", TextureMapping::TEXTURE);
|
||||
enm.insert("Vector", TextureMapping::VECTOR);
|
||||
enm.insert("Normal", TextureMapping::NORMAL);
|
||||
|
||||
return enm;
|
||||
}
|
||||
|
||||
static ShaderEnum texture_mapping_mapping_init()
|
||||
{
|
||||
ShaderEnum enm;
|
||||
|
||||
enm.insert("None", TextureMapping::NONE);
|
||||
enm.insert("X", TextureMapping::X);
|
||||
enm.insert("Y", TextureMapping::Y);
|
||||
enm.insert("Z", TextureMapping::Z);
|
||||
|
||||
return enm;
|
||||
}
|
||||
|
||||
static ShaderEnum texture_mapping_projection_init()
|
||||
{
|
||||
ShaderEnum enm;
|
||||
|
||||
enm.insert("Flat", TextureMapping::FLAT);
|
||||
enm.insert("Cube", TextureMapping::CUBE);
|
||||
enm.insert("Tube", TextureMapping::TUBE);
|
||||
enm.insert("Sphere", TextureMapping::SPHERE);
|
||||
|
||||
return enm;
|
||||
}
|
||||
|
||||
ShaderEnum TextureMapping::type_enum = texture_mapping_type_init();
|
||||
ShaderEnum TextureMapping::mapping_enum = texture_mapping_mapping_init();
|
||||
ShaderEnum TextureMapping::projection_enum = texture_mapping_projection_init();
|
||||
|
||||
TextureMapping::TextureMapping()
|
||||
{
|
||||
translation = make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
@@ -49,12 +49,15 @@ public:
|
||||
|
||||
enum Type { POINT = 0, TEXTURE = 1, VECTOR = 2, NORMAL = 3 };
|
||||
Type type;
|
||||
static ShaderEnum type_enum;
|
||||
|
||||
enum Mapping { NONE = 0, X = 1, Y = 2, Z = 3 };
|
||||
Mapping x_mapping, y_mapping, z_mapping;
|
||||
static ShaderEnum mapping_enum;
|
||||
|
||||
enum Projection { FLAT, CUBE, TUBE, SPHERE };
|
||||
Projection projection;
|
||||
static ShaderEnum projection_enum;
|
||||
|
||||
bool equals(const TextureMapping& other) {
|
||||
return translation == other.translation &&
|
||||
|
Reference in New Issue
Block a user