@@ -609,21 +609,36 @@ ccl::Mesh *convertCommon( const IECoreScene::MeshPrimitive *mesh )
609609
610610 // TODO: Maybe move this to attibutes so it can be shared between meshes?
611611 if ( ( subdivision ) && ( cmesh->subdivision_type != ccl::Mesh::SUBDIVISION_NONE ) && ( !cmesh->subd_params ) )
612+ {
612613 cmesh->subd_params = new ccl::SubdParams ( cmesh );
614+ cmesh->subd_params ->test_steps = 1 ;
615+ cmesh->subd_params ->split_threshold = 1 ;
616+ cmesh->subd_params ->dicing_rate = 1 .0f ;
617+ cmesh->subd_params ->max_level = 1 ;
618+ cmesh->subd_params ->camera = NULL ;
619+ }
613620
614621 // Primitive Variables are Attributes in Cycles
615622 ccl::AttributeSet& attributes = (subdivision) ? cmesh->subd_attributes : cmesh->attributes ;
616623
617624 // Convert Normals
618625 PrimitiveVariable::Interpolation nInterpolation = PrimitiveVariable::Invalid;
619- if ( !triangles )
626+ if ( ( !triangles ) && ( mesh->interpolation () == " catmullClark" ) )
627+ {
628+ if ( const V3fVectorData *normals = normal ( mesh, nInterpolation ) )
629+ {
630+ ccl::Attribute *attr_N = attributes.add ( nInterpolation == PrimitiveVariable::Uniform ? ccl::ATTR_STD_FACE_NORMAL : ccl::ATTR_STD_VERTEX_NORMAL, ccl::ustring (" N" ) );
631+ convertN ( mesh, normals, attr_N, nInterpolation );
632+ }
633+ }
634+ else if ( !triangles )
620635 {
621636 if ( const V3fVectorData *normals = normal ( trimesh.get (), nInterpolation ) )
622637 {
623638 ccl::Attribute *attr_N = attributes.add ( nInterpolation == PrimitiveVariable::Uniform ? ccl::ATTR_STD_FACE_NORMAL : ccl::ATTR_STD_VERTEX_NORMAL, ccl::ustring (" N" ) );
624639 convertN ( trimesh.get (), normals, attr_N, nInterpolation );
625640 }
626- else if ( mesh-> interpolation () != " catmullClark " )
641+ else
627642 {
628643 IECoreScene::MeshNormalsOpPtr normalOp = new IECoreScene::MeshNormalsOp ();
629644 normalOp->inputParameter ()->setValue ( trimesh );
0 commit comments