<commit_before>#include "sceneGraph.h"

#include <xsi_iceattribute.h>
#include <xsi_primitive.h>
#include <xsi_geometry.h>
#include <xsi_application.h>
#include <xsi_model.h>

#include "CommonLog.h"

using namespace XSI;

exoNode::nodeTypeE getNodeType(X3DObject& xObj)
{
 
   //CString sceneRootName = Application().GetActiveSceneRoot().GetFullName();
   //if( xObj.GetFullName().IsEqualNoCase(sceneRootName) ){
   //   return exoNode::SCENE_ROOT;
   //}

   //ESS_LOG_WARNING("name: "<<xObj.GetName().GetAsciiString());
   //ESS_LOG_WARNING("type: "<<xObj.GetType().GetAsciiString());

   CString xObj_GetType = xObj.GetType();
   if(xObj_GetType.IsEqualNoCase(L"null")){
      return  exoNode::ITRANSFORM;
   }
   else if(xObj_GetType.IsEqualNoCase(L"camera"))
   {
      return exoNode::CAMERA;
   }
   else if(xObj_GetType.IsEqualNoCase(L"polymsh")){
      Property geomProp;
      xObj.GetPropertyFromName(L"geomapprox",geomProp);
      LONG subDivLevel = geomProp.GetParameterValue(L"gapproxmordrsl");
      if(subDivLevel > 0){
         return exoNode::SUBD;
      }
      else{
         return exoNode::POLYMESH;
      }
   }
   else if(xObj_GetType.IsEqualNoCase(L"surfmsh")){
      return exoNode::SURFACE;
   }
   else if(xObj_GetType.IsEqualNoCase(L"crvlist"))
   {
      return exoNode::CURVES;
   }
   else if(xObj_GetType.IsEqualNoCase(L"hair"))
   {
      return exoNode::CURVES;
   }
   else if(xObj_GetType.IsEqualNoCase(L"pointcloud"))
   {
      ICEAttribute strandPosition = xObj.GetActivePrimitive().GetGeometry().GetICEAttributeFromName(L"StrandPosition");
      if(strandPosition.IsDefined() && strandPosition.IsValid()){
         return exoNode::CURVES;
      }
      else{
         return exoNode::PARTICLES;
      }
   }

   return exoNode::UNKNOWN;
}

bool hasExtractableTransform( exoNode::nodeTypeE type )
{
   return 
      //type == exoNode::CAMERA ||//the camera seems to already have a transform node
      type == exoNode::POLYMESH ||
      type == exoNode::SUBD ||
      type == exoNode::SURFACE ||<commit_msg>issue #164 -fixed bug in camera export (cameras do have an extractable transform)<commit_after>#include "sceneGraph.h"

#include <xsi_iceattribute.h>
#include <xsi_primitive.h>
#include <xsi_geometry.h>
#include <xsi_application.h>
#include <xsi_model.h>

#include "CommonLog.h"

using namespace XSI;

exoNode::nodeTypeE getNodeType(X3DObject& xObj)
{
 
   //CString sceneRootName = Application().GetActiveSceneRoot().GetFullName();
   //if( xObj.GetFullName().IsEqualNoCase(sceneRootName) ){
   //   return exoNode::SCENE_ROOT;
   //}

   //ESS_LOG_WARNING("name: "<<xObj.GetName().GetAsciiString());
   //ESS_LOG_WARNING("type: "<<xObj.GetType().GetAsciiString());

   CString xObj_GetType = xObj.GetType();
   if(xObj_GetType.IsEqualNoCase(L"null")){
      return  exoNode::ITRANSFORM;
   }
   else if(xObj_GetType.IsEqualNoCase(L"camera"))
   {
      return exoNode::CAMERA;
   }
   else if(xObj_GetType.IsEqualNoCase(L"polymsh")){
      Property geomProp;
      xObj.GetPropertyFromName(L"geomapprox",geomProp);
      LONG subDivLevel = geomProp.GetParameterValue(L"gapproxmordrsl");
      if(subDivLevel > 0){
         return exoNode::SUBD;
      }
      else{
         return exoNode::POLYMESH;
      }
   }
   else if(xObj_GetType.IsEqualNoCase(L"surfmsh")){
      return exoNode::SURFACE;
   }
   else if(xObj_GetType.IsEqualNoCase(L"crvlist"))
   {
      return exoNode::CURVES;
   }
   else if(xObj_GetType.IsEqualNoCase(L"hair"))
   {
      return exoNode::CURVES;
   }
   else if(xObj_GetType.IsEqualNoCase(L"pointcloud"))
   {
      ICEAttribute strandPosition = xObj.GetActivePrimitive().GetGeometry().GetICEAttributeFromName(L"StrandPosition");
      if(strandPosition.IsDefined() && strandPosition.IsValid()){
         return exoNode::CURVES;
      }
      else{
         return exoNode::PARTICLES;
      }
   }

   return exoNode::UNKNOWN;
}

bool hasExtractableTransform( exoNode::nodeTypeE type )
{
   return 
      type == exoNode::CAMERA ||//the camera seems to already have a transform node
      type == exoNode::POLYMESH ||
      type == exoNode::SUBD ||
      type == exoNode::SURFACE ||
{'fraction_non_alphanumeric': 0.1360576923076923, 'fraction_numerical': 0.0016826923076923078, 'mean_word_length': 3.6543624161073827, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2523976', 'n_tokens_mistral': 1541, 'n_tokens_neox': 1498, 'n_words': 220}