您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ thisMObject函数代码示例

51自学网 2021-06-03 08:48:06
  C++
这篇教程C++ thisMObject函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中thisMObject函数的典型用法代码示例。如果您正苦于以下问题:C++ thisMObject函数的具体用法?C++ thisMObject怎么用?C++ thisMObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了thisMObject函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: thisObject

void collisionShapeNode::computeCollisionShape(const MPlug& plug, MDataBlock& data){	//std::cout << collisionShapeNode::collisionMarginOffset << std::endl;	MObject thisObject(thisMObject());	MPlug plgInShape(thisObject, ia_shape);	if (isCompound(plgInShape))	{		m_collision_shape = createCompositeShape(plgInShape);	} else	{		MObject thisObject(thisMObject());		MPlug plgType(thisObject, ia_type);		int type;		plgType.getValue(type);		switch(type)		{		case 4:			//box			m_collision_shape = solver_t::create_box_shape();			break;		case 5:			//sphere			m_collision_shape = solver_t::create_sphere_shape();			break;		case 6:			//plane			m_collision_shape = solver_t::create_plane_shape();			break;		default:			{				MPlugArray plgaConnectedTo;				plgInShape.connectedTo(plgaConnectedTo, true, true);				int numSelectedShapes = plgaConnectedTo.length();				if(numSelectedShapes > 0) 				{					MObject node = plgaConnectedTo[0].node();					m_collision_shape = createCollisionShape(node);				}			}		}	}	//btAssert(m_collision_shape);	data.setClean(plug);}
开发者ID:benelot,项目名称:dynamica,代码行数:56,


示例2: getPlugArrayFromAttrList

// Cache the plug arrays for use in setDependentsDirtybool AlembicCurvesDeformNode::setInternalValueInContext(const MPlug & plug,    const MDataHandle & dataHandle,    MDGContext &){  if (plug == mGeomParamsList) {    MString geomParamsStr = dataHandle.asString();    getPlugArrayFromAttrList(geomParamsStr, thisMObject(), mGeomParamPlugs);  }  else if (plug == mUserAttrsList) {    MString userAttrsStr = dataHandle.asString();    getPlugArrayFromAttrList(userAttrsStr, thisMObject(), mUserAttrPlugs);  }  return false;}
开发者ID:BlackGinger,项目名称:ExocortexCrate,代码行数:16,


示例3: SentinelPlug

MBoundingBox AlembicCurvesLocatorNode::boundingBox() const{  MPlug SentinelPlug(thisMObject(), AlembicCurvesLocatorNode::mSentinelAttr);  int sent = 0;  SentinelPlug.getValue(sent);  return mBoundingBox;}
开发者ID:BlackGinger,项目名称:ExocortexCrate,代码行数:7,


示例4: thisMObject

// function to mark the output dirty once one of the dynamic attributes changesMStatus puttyNode::setDependentsDirty( const MPlug &plugBeingDirtied,	MPlugArray &affectedPlugs ){	if ( plugBeingDirtied.isDynamic())     {		MStatus	status;		MObject thisNode = thisMObject();		// there is a dynamic attribute that is is dirty, so mark         // the outputGeometry dirty		if ( MStatus::kSuccess == status ) 		{//			cerr << "/n###" << plugBeingDirtied.name() <<" "<<output.name();//			MPlug pB( thisNode, puttyNode::outputGeom );//           affectedPlugs.append( pB );			MPlug pD( thisNode, puttyNode::aDynDirty );			pD.setValue(true);    //			affectedPlugs.append( output );		}	}	return( MS::kSuccess );}
开发者ID:Leopardob,项目名称:puttynodes,代码行数:28,


示例5: thisObject

void SoftBodyNode::computeSoftBodyParam(const MPlug &plug, MDataBlock &data){	MObject thisObject(thisMObject());	MObject update;	// update mass	MPlug(thisObject, ca_softBody).getValue(update);	float mass = static_cast<float>( data.inputValue(ia_mass).asDouble() );	this->m_soft_body->set_mass(mass);	// update dynamic friction coefficient	float dynFrictionCoeff = static_cast<float>( data.inputValue(ia_dynamicFrictionCoeff).asDouble() );		this->m_soft_body->set_dynamic_friction_coeff(dynFrictionCoeff);	data.outputValue(ca_softBodyParam).set(true);	// update collision margin	float collisionMargin = data.inputValue(ia_collisionMargin).asFloat();	this->m_soft_body->set_collision_margin(collisionMargin);	data.setClean(plug);	// number of collision clusters	int numClust = data.inputValue(ia_numClusters).asInt();	// this->m_soft_body->set_}
开发者ID:benelot,项目名称:dynamica,代码行数:25,


示例6: thisObject

void rigidBodyNode::clearContactInfo(){	MObject thisObject(thisMObject());	// contactCount	m_contactCount = 0;	MPlug plugContactCount(thisObject, rigidBodyNode::oa_contactCount);	plugContactCount.setValue(m_contactCount);		// contactName	MStringArray stringArray;	stringArray.clear();	MFnStringArrayData stringArrayData;	MObject strArrObject = stringArrayData.create(stringArray);	MPlug plugContactName(thisObject, rigidBodyNode::oa_contactName);	if ( !plugContactName.isNull() )		plugContactName.setValue(strArrObject);	// contactPosition	MPlug plugContactPosition(thisObject, rigidBodyNode::oa_contactPosition);	bool isArray = plugContactPosition.isArray();					MVectorArray vectorArray;	vectorArray.clear();	MFnVectorArrayData vectorArrayData;	MObject arrObject = vectorArrayData.create(vectorArray);			if ( !plugContactPosition.isNull() )		plugContactPosition.setValue(arrObject);}
开发者ID:benelot,项目名称:dynamica,代码行数:33,


示例7: thisMObject

void kgLocator::draw( M3dView & view, const MDagPath & path, 					 M3dView::DisplayStyle style, M3dView::DisplayStatus status ){	MStatus stat;	//First get the value of the height attribute	//of the assocuated locator	MObject thisNode = thisMObject();	MFnDagNode dagFn( thisNode  );  		MPlug heightPlug = dagFn.findPlug( height, &stat );	float heightValue;	heightPlug.getValue( heightValue );			view.beginGL();	glPushAttrib( GL_CURRENT_BIT );			glBegin( GL_LINES );	//Draw a cross	for(unsigned int i=0; i < pts.length(); i+= 2 )	{		glVertex3f(pts[i].x, pts[i].y, pts[i].z );		glVertex3f(pts[i+1].x, pts[i+1].y, pts[i+1].z );	}	//And a vertical spindle	//of the same height as 	//the height attribute	glVertex3f( 0.0f, 0.0f, 0.0f );	glVertex3f( 0.0f, heightValue, 0.0f );		glEnd();		glPopAttrib();	view.endGL();}
开发者ID:kgeorge,项目名称:kgeorge-lib,代码行数:35,


示例8: thisMObject

////	This method allows the custom transform to apply its own locking//	mechanism to rotation. Standard dependency graph attribute locking//	happens automatically and cannot be modified by custom nodes.//	If the plug should not be changed, then the value from the passed savedR//	argument should be return to be used in the transformation matrix.//MEulerRotation rockingTransformCheckNode::applyRotationLocks(const MEulerRotation &toTest,									const MEulerRotation &savedRotation,									MStatus *ReturnStatus ){#ifdef ALLOW_DG_TO_HANDLE_LOCKS	// Allow the DG to handle locking.	return toTest;#else	//	// Implement a simple lock by checking for an existing attribute	// Use the following MEL to add the attribute:	//	addAttr -ln "rotateLockPlug"	//	MStatus status;	MObject object = thisMObject();	MFnDependencyNode depNode( object );	MObject rotateLockPlug = depNode.findPlug( "rotateLockPlug", &status );	// If the lock does not exist that we return the updated value that has	// been passed in	if ( rotateLockPlug.isNull() )		return toTest;		// We have a lock.  Returned the original saved value of the	// rotation.	return savedRotation;#endif}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:35,


示例9: thisMObject

void NuiMayaDeviceGrabber::addCallbacks(){	MStatus status;		MObject node = thisMObject();	fCallbackIds.append( MNodeMessage::addAttributeChangedCallback(node, attrChangedCB, (void*)this) );}
开发者ID:hustztz,项目名称:NatureUserInterfaceStudio,代码行数:7,


示例10: thisMObject

// The compute() method does the actual work of the node using the inputs// of the node to generate its output.//// Compute takes two parameters: plug and data.// - Plug is the the data value that needs to be recomputed// - Data provides handles to all of the nodes attributes, only these//   handles should be used when performing computations.//MStatus affects::compute( const MPlug& plug, MDataBlock& data ){    MStatus status;    MObject thisNode = thisMObject();    MFnDependencyNode fnThisNode( thisNode );    fprintf(stderr,"affects::compute(), plug being computed is /"%s/"/n",            plug.name().asChar());    if ( plug.partialName() == "B" ) {        // Plug "B" is being computed. Assign it the value on plug "A"        // if "A" exists.        //        MPlug pA = fnThisNode.findPlug( "A", &status );        if ( MStatus::kSuccess == status ) {            fprintf(stderr,"/t/t... found dynamic attribute /"A/", copying its value to /"B/"/n");            MDataHandle inputData = data.inputValue( pA, &status );            CHECK_MSTATUS( status );            int value = inputData.asInt();            MDataHandle outputHandle = data.outputValue( plug );            outputHandle.set( value );            data.setClean(plug);        }    } else {        return MS::kUnknownParameter;    }    return( MS::kSuccess );}
开发者ID:EricTRocks,项目名称:Maya-devkit,代码行数:36,


示例11: fileNamePlug

// returns the list of files to archive.MStringArray AlembicNode::getFilesToArchive(    bool /* shortName */,    bool unresolvedName,    bool /* markCouldBeImageSequence */) const{    MStringArray files;    MStatus status = MS::kSuccess;    MPlug fileNamePlug(thisMObject(), mAbcFileNameAttr);    MString fileName = fileNamePlug.asString(MDGContext::fsNormal, &status);    if (status == MS::kSuccess && fileName.length() > 0) {        if(unresolvedName)        {            files.append(fileName);        }        else        {            //unresolvedName is false, resolve the path via MFileObject.            MFileObject fileObject;            fileObject.setRawFullName(fileName);            files.append(fileObject.resolvedFullName());        }    }    return files;}
开发者ID:matsbtegner,项目名称:alembic,代码行数:28,


示例12: MFloatPoint

sgBLocator_fromGeo::sgBLocator_fromGeo(){	m_pointArr.setLength(6); 	m_pointArr[0] = MFloatPoint(  1,  0, 0 );	m_pointArr[1] = MFloatPoint( -1,  0, 0 );	m_pointArr[2] = MFloatPoint(  0, -1, 0 );	m_pointArr[3] = MFloatPoint(  0,  1, 0 );	m_pointArr[4] = MFloatPoint(  0,  0, 1 );	m_pointArr[5] = MFloatPoint(  0,  0, -1 );	m_boundingBox.clear();    m_boundingBox.expand( MVector( 1.0, 1.0, 1.0 ) );    m_boundingBox.expand( MVector( -1.0, -1.0, -1.0 ) );	m_colorActive =  MColor( 1.0f, 1.0f, 1.0f );	m_colorLead   =	 MColor( .26f, 1.0f, .64f );	m_colorDefault = MColor( 1.0f, 1.0f, 0.0f );	m_lineWidth = 1;	MFnDependencyNode fnNode( thisMObject() );	MPlug plugOutput = fnNode.findPlug( aOutputValue );	MPlug plugVis    =fnNode.findPlug( "v" );	MDGModifier dgModifier;	dgModifier.connect( plugOutput, plugVis );}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:28,


示例13: useActiveView

void ProxyViz::processPickInView(const int & plantTyp){	useActiveView();/// not needed?//  _viewport.refresh();		MObject node = thisMObject();		MPlug gateHighPlg(node, alodgatehigh);	float gateHigh = gateHighPlg.asFloat();		MPlug gateLowPlg(node, alodgatelow);	float gateLow = gateLowPlg.asFloat();	//	MPlug gcPlg(node, agroupcount);//	int groupCount = gcPlg.asInt();	//	MPlug giPlg(node, ainstanceId);//	int groupId = giPlg.asInt();		MPlug perPlg(node, aconvertPercentage);	double percentage = perPlg.asDouble();	pickVisiblePlants(gateLow, gateHigh, percentage, plantTyp);	AHelper::Info<int>("proxyviz picks up n visible plants", numActivePlants() );}
开发者ID:spinos,项目名称:aphid,代码行数:25,


示例14: plug

MStatus pnTriangles::getFloat3(MObject attr, float value[3]){	MStatus status;	// Get the attr to use	//	MPlug	plug(thisMObject(), attr);	MObject object;	status = plug.getValue(object);	if (!status)	{		status.perror("pnTrianglesNode::bind plug.getValue.");		return status;	}	MFnNumericData data(object, &status);	if (!status)	{		status.perror("pnTrianglesNode::bind construct data.");		return status;	}	status = data.getData(value[0], value[1], value[2]);	if (!status)	{		status.perror("pnTrianglesNode::bind get values.");		return status;	}	return MS::kSuccess;}
开发者ID:DimondTheCat,项目名称:xray,代码行数:33,


示例15: layerFilenamesPlug

// returns the list of files to archive.MStringArray AlembicNode::getFilesToArchive(    bool /* shortName */,    bool unresolvedName,    bool /* markCouldBeImageSequence */) const{    MStringArray files;    MStatus status = MS::kSuccess;    MPlug layerFilenamesPlug(thisMObject(), mAbcLayerFileNamesAttr);    MFnStringArrayData fnSAD( layerFilenamesPlug.asMObject() );	MStringArray layerFilenames = fnSAD.array();	for( unsigned int i = 0; i < layerFilenames.length(); i++ )	{		MString fileName = layerFilenames[i];		if (status == MS::kSuccess && fileName.length() > 0) {			if(unresolvedName)			{				files.append(fileName);			}			else			{				//unresolvedName is false, resolve the path via MFileObject.				MFileObject fileObject;				fileObject.setRawFullName(fileName);				files.append(fileObject.resolvedFullName());			}		}	}    return files;}
开发者ID:poparteu,项目名称:alembic,代码行数:35,


示例16: thisObject

void hingeConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock& data){    //std::cout << "hingeConstraintNode::computeRigidBodyParam data.className=" << std::endl;    MObject thisObject(thisMObject());    MObject update;        MPlug(thisObject, ca_constraint).getValue(update);    if(m_constraint) {		float damping = (float) data.inputValue(ia_damping).asDouble();		m_constraint->set_damping(damping);		float lower = (float) data.inputValue(ia_lowerLimit).asDouble();		float upper = (float) data.inputValue(ia_upperLimit).asDouble();		float limit_softness = (float) data.inputValue(ia_limitSoftness).asDouble();		float bias_factor = (float) data.inputValue(ia_biasFactor).asDouble();		float relaxation_factor = (float) data.inputValue(ia_relaxationFactor).asDouble();		m_constraint->set_limit(lower, upper, limit_softness, bias_factor, relaxation_factor);		float* axis = data.inputValue(ia_hingeAxis).asFloat3();		m_constraint->set_axis(vec3f(axis[0], axis[1], axis[2]));		bool enable_motor = data.inputValue(ia_enableAngularMotor).asBool();		float motorTargetVelocity = (float) data.inputValue(ia_motorTargetVelocity).asDouble();		float maxMotorImpulse = (float) data.inputValue(ia_maxMotorImpulse).asDouble();		m_constraint->enable_motor(enable_motor, motorTargetVelocity, maxMotorImpulse);    }    data.outputValue(ca_constraintParam).set(true);    data.setClean(plug);}
开发者ID:BlackYoup,项目名称:medusa,代码行数:31,


示例17: thisObject

void sixdofConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock& data){   // std::cout << "sixdofConstraintNode::computeRigidBodyParam" << std::endl;    MObject thisObject(thisMObject());    MObject update;        MPlug(thisObject, ca_constraint).getValue(update);    if(m_constraint) {        m_constraint->set_damping((float) data.inputValue(ia_damping).asDouble());		m_constraint->set_breakThreshold((float) data.inputValue(ia_breakThreshold).asDouble());		vec3f lowLin, uppLin, lowAng, uppAng;		float3& mLowLin = data.inputValue(ia_lowerLinLimit).asFloat3();		float3& mUppLin = data.inputValue(ia_upperLinLimit).asFloat3();		float3& mLowAng = data.inputValue(ia_lowerAngLimit).asFloat3();		float3& mUppAng = data.inputValue(ia_upperAngLimit).asFloat3();		for(int j = 0; j < 3; j++) 		{			lowLin[j] = mLowLin[j];			uppLin[j] = mUppLin[j];			lowAng[j] = deg2rad(mLowAng[j]);			uppAng[j] = deg2rad(mUppAng[j]);		}		m_constraint->set_LinLimit(lowLin, uppLin);		m_constraint->set_AngLimit(lowAng, uppAng);    }    data.outputValue(ca_constraintParam).set(true);    data.setClean(plug);}
开发者ID:ristopuukko,项目名称:boing,代码行数:31,


示例18: thisMObject

void curvedArrows::draw( M3dView & view, const MDagPath & /*path*/, 							 M3dView::DisplayStyle style,							 M3dView::DisplayStatus status ){ 	// Get the size	//	MObject thisNode = thisMObject();	MPlug tPlug = MPlug( thisNode, aTransparency ); 	MPlug cPlug = MPlug( thisNode, aTheColor ); 	float r, g, b, a; 	MObject color; 	cPlug.getValue( color ); 	MFnNumericData data( color ); 	data.getData( r, g, b ); 	tPlug.getValue( a ); 	view.beginGL(); 	if( (style == M3dView::kFlatShaded) ||	    (style == M3dView::kGouraudShaded) ) {		// Push the color settings		// 		glPushAttrib( GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT | 					  GL_PIXEL_MODE_BIT ); 			if ( a < 1.0f ) { 			glEnable( GL_BLEND );			glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );		}				glColor4f( r, g, b, a );						glBegin( GL_TRIANGLES ); 		unsigned int i;		for ( i = 0; i < fsFaceListSize; i ++ ) { 			unsigned int *vid = fsFaceList[i];			unsigned int *nid = fsFaceVertexNormalList[i]; 			for ( unsigned int j = 0; j < 3; j ++ ) { 				glNormal3d( fsNormalList[nid[j]-1][0], 							fsNormalList[nid[j]-1][1], 							fsNormalList[nid[j]-1][2] );				glVertex3d( fsVertexList[vid[j]-1][0], 							fsVertexList[vid[j]-1][1],							fsVertexList[vid[j]-1][2] ); 			}		}		glEnd(); 			glPopAttrib(); 		drawEdgeLoop( view, status ); 	} else { 		drawEdgeLoop( view, status ); 	}	view.endGL(); }
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:59,


示例19: thisMObject

void BasicLocator::postConstructor(){	//rename the locator shape post construction	MObject oThis = thisMObject();	MFnDependencyNode fnNode(oThis);	fnNode.setName("basicLocator#");}
开发者ID:jonntd,项目名称:mayaPlugins,代码行数:8,


示例20: plug

bool BasicLocator::isTransparent() const{	MPlug plug(thisMObject(), aIsTransparent);	bool value;	plug.getValue(value);	return value;}
开发者ID:jonntd,项目名称:mayaPlugins,代码行数:8,


示例21: thisMObject

void ProxyViz::pressToLoad(){	MObject thisNode = thisMObject();	MPlug plugc( thisNode, acachename );	const MString filename = plugc.asString();	if(filename != "")		loadExternal(replaceEnvVar(filename).c_str());	else 		AHelper::Info<int>("ProxyViz error empty external cache filename", 0);}
开发者ID:spinos,项目名称:aphid,代码行数:10,



注:本文中的thisMObject函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ thisObject函数代码示例
C++ think函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。