diff --git a/pandatool/src/bam/bamToEgg.cxx b/pandatool/src/bam/bamToEgg.cxx index 32773804e5..396fd23433 100644 --- a/pandatool/src/bam/bamToEgg.cxx +++ b/pandatool/src/bam/bamToEgg.cxx @@ -421,7 +421,7 @@ convert_triangles(const GeomVertexData *vertex_data, // Check for a color scale. LVecBase4f color_scale(1.0f, 1.0f, 1.0f, 1.0f); - const ColorScaleAttrib *csa = net_state->get_color_scale(); + const ColorScaleAttrib *csa = DCAST(ColorScaleAttrib, net_state->get_attrib(ColorScaleAttrib::get_class_type())); if (csa != (const ColorScaleAttrib *)NULL) { color_scale = csa->get_scale(); } @@ -430,7 +430,7 @@ convert_triangles(const GeomVertexData *vertex_data, bool has_color_override = false; bool has_color_off = false; Colorf color_override; - const ColorAttrib *ca = net_state->get_color(); + const ColorAttrib *ca = DCAST(ColorAttrib, net_state->get_attrib(ColorAttrib::get_class_type())); if (ca != (const ColorAttrib *)NULL) { if (ca->get_color_type() == ColorAttrib::T_flat) { has_color_override = true; @@ -447,7 +447,7 @@ convert_triangles(const GeomVertexData *vertex_data, // Check for a texture. EggTexture *egg_tex = (EggTexture *)NULL; - const TextureAttrib *ta = net_state->get_texture(); + const TextureAttrib *ta = DCAST(TextureAttrib, net_state->get_attrib(TextureAttrib::get_class_type())); if (ta != (const TextureAttrib *)NULL) { egg_tex = get_egg_texture(ta->get_texture()); } diff --git a/pandatool/src/bam/eggToBam.cxx b/pandatool/src/bam/eggToBam.cxx index b9b6832fc8..281e22f39c 100644 --- a/pandatool/src/bam/eggToBam.cxx +++ b/pandatool/src/bam/eggToBam.cxx @@ -351,7 +351,7 @@ collect_textures(PandaNode *node) { //////////////////////////////////////////////////////////////////// void EggToBam:: collect_textures(const RenderState *state) { - const TextureAttrib *tex_attrib = state->get_texture(); + const TextureAttrib *tex_attrib = DCAST(TextureAttrib, state->get_attrib(TextureAttrib::get_class_type())); if (tex_attrib != (TextureAttrib *)NULL) { int num_on_stages = tex_attrib->get_num_on_stages(); for (int i = 0; i < num_on_stages; ++i) {