本文整理汇总了C++中MDagPath::numberOfShapesDirectlyBelow方法的典型用法代码示例。如果您正苦于以下问题:C++ MDagPath::numberOfShapesDirectlyBelow方法的具体用法?C++ MDagPath::numberOfShapesDirectlyBelow怎么用?C++ MDagPath::numberOfShapesDirectlyBelow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MDagPath
的用法示例。
在下文中一共展示了MDagPath::numberOfShapesDirectlyBelow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getShapeNode
MStatus sgCurveEditBrush_context::getShapeNode( MDagPath& path )
{
MStatus status;
if ( path.apiType() == MFn::kNurbsCurve )
{
return MS::kSuccess;
}
unsigned int numShapes;
status = path.numberOfShapesDirectlyBelow( numShapes );
CHECK_MSTATUS_AND_RETURN_IT( status );
for ( unsigned int i = 0; i < numShapes; ++i )
{
status = path.extendToShapeDirectlyBelow( i );
CHECK_MSTATUS_AND_RETURN_IT( status );
if ( !path.hasFn( MFn::kNurbsCurve ) )
{
path.pop();
continue;
}
MFnDagNode fnNode( path, &status );
CHECK_MSTATUS_AND_RETURN_IT( status );
if ( !fnNode.isIntermediateObject() )
{
return MS::kSuccess;
}
path.pop();
}
return MS::kFailure;
}
示例2: FindSkinnerNodesInHierarchy
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
MStatus CVsSkinnerCmd::FindSkinnerNodesInHierarchy(
const MDagPath &iDagPath,
MSelectionList &oList )
{
MStatus retVal( MS::kFailure );
MDagPath rDagPath( iDagPath ); // Root dag path
while ( rDagPath.length() > 1U )
{
rDagPath.pop();
}
MDagPath mDagPath;
MDagPath sDagPath;
uint nShapes;
MItDag dIt;
if ( rDagPath.length() )
{
dIt.reset( rDagPath );
}
for ( ; !dIt.isDone(); dIt.next() )
{
if ( !dIt.getPath( mDagPath ) )
continue;
mDagPath.numberOfShapesDirectlyBelow( nShapes );
for ( uint i( 0U ); i != nShapes; ++i )
{
sDagPath = mDagPath;
sDagPath.extendToShapeDirectlyBelow( i );
if ( !IsSkinnerNode( sDagPath ) )
continue;
oList.add( sDagPath, MObject::kNullObj, true );
retVal = MS::kSuccess;
}
if ( !ConnectedToSkinnerNode( mDagPath, sDagPath ) )
continue;
oList.add( sDagPath, MObject::kNullObj, true );
retVal = MS::kSuccess;
}
return retVal;
}
示例3: getDagPath
MStatus Object::setShapesVisibility(bool visible, MTypeId & typeId) {
MStatus status;
MDagPath dagPath = getDagPath(status);
if (!status) {
status.perror("Object::getDagPath");
return status;
}
unsigned int numShapes;
if (!(status = dagPath.numberOfShapesDirectlyBelow(numShapes))) {
status.perror("MDagPath::numberOfShapesDirectlyBelow");
return status;
}
for(unsigned int i = 0; i < numShapes; ++i) {
MDagPath shape = dagPath;
if (!(status = shape.extendToShapeDirectlyBelow(i))) {
status.perror("MDagPath::extendToShapeDirectlyBelow");
return status;
}
MFnDagNode shape_dagNode(shape);
if (shape_dagNode.typeId(&status) == typeId) {
MPlug visibilityPlug(shape.node(), shape_dagNode.findPlug("visibility", &status));
if (!status) {
status.perror("MFnDagNode::findPlug");
return status;
}
if (!(status = visibilityPlug.setBool(visible))) {
status.perror("MPlug::setBool");
return status;
}
}
else if (!status) {
status.perror("MFnDagNode::typeId");
return status;
}
}
return MStatus::kSuccess;
}
示例4: CVCurveFromObject
MStatus CVCurveFromObject(const Model::Object & object, MPointArray & array) {
MStatus status;
MDagPath dagPath = object.getDagPath(status);
if (!status) {
status.perror("Object::getDagPath");
return status;
}
MDagPath shape = dagPath;
unsigned int numShapes;
if (!(status = dagPath.numberOfShapesDirectlyBelow(numShapes))) {
status.perror("MDagPath::numberOfShapesDirectlyBelow");
return status;
}
for(unsigned int i = 0; i < numShapes; ++i) {
if (!(status = shape.extendToShapeDirectlyBelow(i))) {
status.perror("MDagPath::extendToShapeDirectlyBelow");
return status;
}
if (shape.hasFn(MFn::kNurbsCurve)) {
MFnNurbsCurve nurbsCurve(shape);
if (!(status = nurbsCurve.getCVs(array, MSpace::kWorld))) {
status.perror("MFnNurbsCurve::getCVs");
return status;
}
return MStatus::kSuccess;
}
else
std::cerr << "No MFnNurbsCurve!" << std::endl;
}
return MStatus::kNotFound;
}
示例5: DoNewVolumes
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
MSelectionList CVsSkinnerCmd::DoNewVolumes(
const MDagPath &skinnerPath,
const MSelectionList &skeletonList )
{
MSelectionList retList;
const bool optSelected( m_undo.ArgDatabase().isFlagSet( kOptSelected ) );
MSelectionList optSelection;
m_undo.ArgDatabase().getObjects( optSelection );
// TODO: Maybe some fancier logic to only create volumes on joints that make sense?
// Perhaps the ol' has children but no shapes gag? Watch out for vstHelperBones!
MDagPath mDagPath;
for ( MItSelectionList sIt( optSelection ); !sIt.isDone(); sIt.next() )
{
if ( sIt.itemType() == MItSelectionList::kDagSelectionItem && sIt.getDagPath( mDagPath ) && mDagPath.hasFn( MFn::kTransform ) )
{
if ( optSelected )
{
MObject cObj( DoNewVolume( skinnerPath, mDagPath ) );
if ( cObj.isNull() )
{
mwarn << "Couldn't create new volume on " << skinnerPath.partialPathName()
<< " using " << mDagPath.partialPathName() << " as a parent" << std::endl;
}
else
{
retList.add( skinnerPath, cObj, true );
}
}
else
{
MItDag dIt;
for ( dIt.reset( mDagPath ); !dIt.isDone(); dIt.next() )
{
dIt.getPath( mDagPath );
if ( mDagPath.childCount() )
{
uint nShapes( 0 );
mDagPath.numberOfShapesDirectlyBelow( nShapes );
if ( nShapes == 0U || mDagPath.hasFn( MFn::kJoint ) )
{
MObject cObj( DoNewVolume( skinnerPath, mDagPath ) );
if ( cObj.isNull() )
{
mwarn << "Couldn't create new volume on " << skinnerPath.partialPathName()
<< " using " << mDagPath.partialPathName() << " as a parent" << std::endl;
}
else
{
retList.add( skinnerPath, cObj, true );
}
}
}
}
}
}
}
return retList;
}