本文整理汇总了C++中OP_Node类的典型用法代码示例。如果您正苦于以下问题:C++ OP_Node类的具体用法?C++ OP_Node怎么用?C++ OP_Node使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OP_Node类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save_gdp_to_disk
void wendy_GIO_ROP::save_gdp_to_disk( char *arnold_dso_path,OP_Context &context,char *savePath)
{
OP_Node * node = this->getInput(0);
if(node)
{
SOP_Node * getNode = node->castToSOPNode();
std::cout<<"the node name is"<<getNode->getName()<<std::endl;
GU_Detail *sop_detail = (GU_Detail *)getNode->getCookedGeo(context);
// save the geometry into desk
g_global_io global_io;
updateAttributeList(global_io,sop_detail);
ofstream fout;
fout.open(savePath,std::ios_base::binary);
global_io.save(fout);
fout.close();
// mata data for the ass
save_mata_ass(arnold_dso_path,savePath,sop_detail);
}
else
{
std::cout<<"No Sop Geometry Connect!\n";
return ;
}
}
示例2: OPgetDirector
OP_Node *HoudiniScene::retrieveNode( bool content, MissingBehaviour missingBehaviour ) const
{
OP_Node *node = OPgetDirector()->findNode( m_nodePath );
if ( node && content )
{
if ( OP_Node *contentNode = locateContent( node ) )
{
node = contentNode;
}
}
if ( missingBehaviour == ThrowIfMissing )
{
if ( !node )
{
throw Exception( "IECoreHoudini::HoudiniScene: Node \"" + m_nodePath.toStdString() + "\" no longer exists." );
}
if ( !node->isManager() && !node->castToOBJNode() )
{
throw Exception( "IECoreHoudini::HoudiniScene: Node \"" + m_nodePath.toStdString() + "\" is not a valid OBJ." );
}
}
return node;
}
示例3: retrieveNode
Imath::M44d HoudiniScene::readTransformAsMatrix( double time ) const
{
OP_Node *node = retrieveNode();
if ( node->isManager() )
{
return Imath::M44d();
}
OBJ_Node *objNode = node->castToOBJNode();
if ( !objNode )
{
return Imath::M44d();
}
// paths embedded within a sop always have identity transforms
if ( m_contentIndex )
{
return Imath::M44d();
}
UT_DMatrix4 matrix;
OP_Context context( time );
if ( !objNode->getLocalTransform( context, matrix ) )
{
return Imath::M44d();
}
return IECore::convert<Imath::M44d>( matrix );
}
示例4: SetupCVEX
void Daemon::SetupCVEX(UT_String script)
{
vexsrc=script;
SHOP_Node *shop = caller->findSHOPNode(vexsrc);
caller->addExtraInput(shop, OP_INTEREST_DATA);
shop->buildVexCommand(vexsrc, shop->getSpareParmTemplates(), now);
shop->buildShaderString(script, now, 0);
UT_String op = "op:";
op += vexsrc;
vexsrc=op;
char *argv[4096];
int argc = vexsrc.parse(argv, 4096);
//OP_Caller C(caller);
//context.setOpCaller(&C);
//context.setTime(now);
context.addInput("P",CVEX_TYPE_VECTOR3,true);
context.load(argc, argv );
useVex = context.isLoaded();
if(useVex)
{
CVEX_Value* inv = context.findInput("P",CVEX_TYPE_VECTOR3);
inv->setData(in,1);
CVEX_Value* outv = context.findOutput("P",CVEX_TYPE_VECTOR3);
outv->setData(out,1);
};
};
示例5: retrieveChild
SceneInterfacePtr HoudiniScene::child( const Name &name, MissingBehaviour missingBehaviour )
{
Path contentPath;
OP_Node *child = retrieveChild( name, contentPath, missingBehaviour );
if ( !child )
{
return 0;
}
UT_String nodePath;
child->getFullPath( nodePath );
Path rootPath;
rootPath.resize( m_rootIndex );
std::copy( m_path.begin(), m_path.begin() + m_rootIndex, rootPath.begin() );
/// \todo: is this really what we want? can we just pass rootIndex and contentIndex instead?
return new HoudiniScene( nodePath, contentPath, rootPath, m_defaultTime, m_splitter );
}
示例6: if
OP_Node *HoudiniScene::locateContent( OP_Node *node ) const
{
OBJ_Node *objNode = node->castToOBJNode();
if ( node->isManager() || ( objNode && objNode->getObjectType() == OBJ_SUBNET ) )
{
for ( int i=0; i < node->getNchildren(); ++i )
{
OP_Node *child = node->getChild( i );
if ( child->getName().equal( contentName.c_str() ) )
{
return child;
}
}
}
else if ( objNode && objNode->getObjectType() == OBJ_GEOMETRY )
{
return objNode;
}
return 0;
}
示例7: LiveScene
SceneInterfacePtr LiveScene::retrieveScene( const Path &path, MissingBehaviour missingBehaviour ) const
{
Path rootPath, emptyPath;
rootPath.resize( m_rootIndex );
std::copy( m_path.begin(), m_path.begin() + m_rootIndex, rootPath.begin() );
LiveScenePtr rootScene = new LiveScene();
rootScene->setDefaultTime( m_defaultTime );
for ( Path::const_iterator it = rootPath.begin(); it != rootPath.end(); ++it )
{
rootScene = IECore::runTimeCast<LiveScene>( rootScene->child( *it ) );
if ( !rootScene )
{
return 0;
}
}
UT_String rootNodePath;
OP_Node *node = rootScene->retrieveNode();
if ( !node )
{
return 0;
}
node->getFullPath( rootNodePath );
/// \todo: is this really what we want? can we just pass rootIndex and contentIndex instead?
SceneInterfacePtr scene = new LiveScene( rootNodePath, emptyPath, rootPath, m_defaultTime, m_splitter.get() );
for ( Path::const_iterator it = path.begin(); it != path.end(); ++it )
{
scene = scene->child( *it, missingBehaviour );
if ( !scene )
{
return 0;
}
}
return scene;
}
示例8: retrieveNode
Imath::M44d LiveScene::readWorldTransformAsMatrix( double time ) const
{
OP_Node *node = retrieveNode();
if ( node->isManager() )
{
return Imath::M44d();
}
OBJ_Node *objNode = node->castToOBJNode();
if ( !objNode )
{
return Imath::M44d();
}
UT_DMatrix4 matrix;
OP_Context context( adjustTime( time ) );
if ( !objNode->getWorldTransform( matrix, context ) )
{
return Imath::M44d();
}
return IECore::convert<Imath::M44d>( matrix );
}
示例9: DOPPATH
ROP_RENDER_CODE
ROP_DopField::renderFrame(fpreal time, UT_Interrupt *)
{
OP_Node *op;
DOP_Parent *dopparent;
UT_String doppath, savepath;
UT_String dopobject, dopdata;
if( !executePreFrameScript(time) )
return ROP_ABORT_RENDER;
DOPPATH(doppath, time);
if( !doppath.isstring() )
{
addError(ROP_MESSAGE, "Invalid DOP path");
return ROP_ABORT_RENDER;
}
op = findNode(doppath);
if (!op)
{
addError(ROP_COOK_ERROR, (const char *)doppath);
return ROP_ABORT_RENDER;
}
dopparent = op ? op->castToDOPParent() : 0;
if( !dopparent )
{
addError(ROP_COOK_ERROR, (const char *)doppath);
return ROP_ABORT_RENDER;
}
DOPOBJECT(dopobject, time);
DOPDATA(dopdata, time);
OUTPUT(savepath, time);
time = DOPsetBestTime(dopparent, time);
OP_Context context(time);
const SIM_Object *object;
object = dopparent->findObjectFromString(dopobject, 0, 0, time);
if (!object)
{
addError(ROP_COOK_ERROR, (const char *)dopobject);
return ROP_ABORT_RENDER;
}
const SIM_Data *data;
data = object->getConstNamedSubData(dopdata);
if (!data)
{
addError(ROP_COOK_ERROR, (const char *) dopdata);
return ROP_ABORT_RENDER;
}
// Create our GDP.
GU_Detail *gdp = new GU_Detail();
const SIM_ScalarField *scalarfield = SIM_DATA_CASTCONST(data, SIM_ScalarField);
if (scalarfield)
{
addField(gdp, scalarfield->getField());
}
const SIM_VectorField *vectorfield = SIM_DATA_CASTCONST(data, SIM_VectorField);
if (vectorfield)
{
for (int i = 0; i < 3; i++)
{
addField(gdp, vectorfield->getField(i));
}
}
const SIM_MatrixField *matrixfield = SIM_DATA_CASTCONST(data, SIM_MatrixField);
if (matrixfield)
{
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
{
addField(gdp, matrixfield->getField(i, j));
}
}
if (!gdp->save((const char *)savepath, 0, 0).success())
{
addError(ROP_SAVE_ERROR, (const char *)savepath);
return ROP_ABORT_RENDER;
}
// DO NOT delete gdp if we are stealing the voxels!
// delete gdp;
if (ALFPROGRESS() && (myEndTime != myStartTime))
{
fpreal fpercent = (time - myStartTime) / (myEndTime - myStartTime);
int percent = (int)SYSrint(fpercent * 100);
//.........这里部分代码省略.........