void importMetadata(INode* pNode, AbcG::IObject& iObj)
{
  ESS_PROFILE_FUNC();

  AbcG::IObject* metadataChild = NULL;

  if (getCompoundFromObject(iObj).getPropertyHeader(".metadata") == NULL) {
    return;
  }

  Abc::IStringArrayProperty metaDataProp =
      Abc::IStringArrayProperty(getCompoundFromObject(iObj), ".metadata");
  Abc::StringArraySamplePtr ptr = metaDataProp.getValue(0);
  // for(unsigned int i=0;i<ptr->size();i++){
  //	const char* name = ptr->get()[i].c_str();
  //	Abc::StringArraySamplePtr ptr = metaDataProp.getValue(0);
  //
  //}

  std::stringstream exeBuffer;

  exeBuffer << GET_MAXSCRIPT_NODE(pNode);
  exeBuffer << "ImportMetadata mynode2113";

  exeBuffer << "#(";

  for (int i = 0; i < ptr->size() - 1; i++) {
    exeBuffer << "\"";
    exeBuffer << ptr->get()[i];
    exeBuffer << "\", ";
  }
  exeBuffer << "\"";
  exeBuffer << ptr->get()[ptr->size() - 1];
  exeBuffer << "\")";

  exeBuffer << " \n";

  ExecuteMAXScriptScript(EC_UTF8_to_TCHAR((char*)exeBuffer.str().c_str()));

  // delete[] szBuffer;
}
Beispiel #2
0
//-*****************************************************************************
void ICameraSchema::init( const Abc::Argument &iArg0,
                          const Abc::Argument &iArg1 )
{
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "ICameraSchema::init()" );

    AbcA::CompoundPropertyReaderPtr _this = this->getPtr();

    Abc::Arguments args;
    iArg0.setInto( args );
    iArg1.setInto( args );


    m_coreProperties = Abc::IScalarProperty( _this, ".core",
        args.getErrorHandlerPolicy() );

    // none of the things below here are guaranteed to exist

    if ( this->getPropertyHeader( ".childBnds" ) != NULL )
    {
        m_childBoundsProperty = Abc::IBox3dProperty( _this, ".childBnds",
            iArg0, iArg1 );
    }

    if ( this->getPropertyHeader( ".arbGeomParams" ) != NULL )
    {
        m_arbGeomParams = Abc::ICompoundProperty( _this, ".arbGeomParams",
            args.getErrorHandlerPolicy() );
    }

    if ( this->getPropertyHeader( ".userProperties" ) != NULL )
    {
        m_userProperties = Abc::ICompoundProperty( _this, ".userProperties",
            args.getErrorHandlerPolicy() );
    }

    // read the film back operations
    const AbcA::PropertyHeader * header =
        this->getPropertyHeader(".filmBackOps");

    // read it from the scalar property
    if ( header != NULL && header->isScalar() )
    {
        Abc::IScalarProperty opsProp( _this, ".filmBackOps",
            args.getErrorHandlerPolicy() );

        size_t numOps = opsProp.getDataType().getExtent();

        std::vector < std::string > ops( numOps );
        opsProp.get( &ops.front() );
        m_ops.resize( ops.size() );


        for ( size_t i = 0; i < numOps; ++i )
        {
            m_ops[i] = FilmBackXformOp( ops[i] );
        }

    }
    // read it from the array property
    else if ( header != NULL && header->isArray() )
    {
        Abc::IStringArrayProperty opsProp( _this, ".filmBackOps",
            iArg0, iArg1 );

        Abc::StringArraySamplePtr ops;
        opsProp.get( ops );
        size_t numOps = ops->size();
        m_ops.resize( numOps );


        for ( size_t i = 0; i < numOps; ++i )
        {
            m_ops[i] = FilmBackXformOp( (*ops)[i] );
        }
    }

    header = this->getPropertyHeader( ".filmBackChannels" );

    if ( header != NULL && header->isScalar() )
    {
        m_smallFilmBackChannels = Abc::IScalarProperty( _this,
            ".filmBackChannels", args.getErrorHandlerPolicy() );
    }
    else if ( header != NULL && header->isArray() )
    {
        m_largeFilmBackChannels = Abc::IDoubleArrayProperty( _this,
            ".filmBackChannels", iArg0, iArg1 );
    }

    ALEMBIC_ABC_SAFE_CALL_END_RESET();
}