From 1918b56288c55b7f12b1ffb499da02659a8ca9a8 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 29 Oct 2004 22:22:49 +0000 Subject: [PATCH] kCamera check -- for drose by skyler --- pandatool/src/mayaegg/mayaToEggConverter.cxx | 30 +++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index 9f131367f5..68e6f46659 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -701,13 +701,6 @@ process_model_node(MayaNodeDesc *node_desc) { << "\n"; } - } else if (dag_path.hasFn(MFn::kCamera)) { - if (mayaegg_cat.is_debug()) { - mayaegg_cat.debug() - << "Ignoring camera node " << path - << "\n"; - } - } else if (dag_path.hasFn(MFn::kLight)) { if (mayaegg_cat.is_debug()) { mayaegg_cat.debug() @@ -789,6 +782,29 @@ process_model_node(MayaNodeDesc *node_desc) { make_locator(dag_path, dag_node, egg_group); } + } else if (dag_path.hasFn(MFn::kCamera)) { + // For some reason, Maya 6.0 on the Windows build seems to report + // that every node has kCamera, even if it's not a camera. This + // second check is designed to filter those. + MFnCamera camera(dag_path, &status); + if (!status) { + if (mayaegg_cat.is_debug()) { + mayaegg_cat.debug() + << "Node is not really a camera: " << path << "\n"; + + // Just a generic node. + EggGroup *egg_group = _tree.get_egg_group(node_desc); + get_transform(node_desc, dag_path, egg_group); + } + + } else { + if (mayaegg_cat.is_debug()) { + mayaegg_cat.debug() + << "Ignoring camera node " << path + << "\n"; + } + } + } else { // Just a generic node. EggGroup *egg_group = _tree.get_egg_group(node_desc);