本文整理汇总了C++中MEvent::isModifierNone方法的典型用法代码示例。如果您正苦于以下问题:C++ MEvent::isModifierNone方法的具体用法?C++ MEvent::isModifierNone怎么用?C++ MEvent::isModifierNone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEvent
的用法示例。
在下文中一共展示了MEvent::isModifierNone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mesh
MStatus grabUVContext::doDrag ( MEvent & event, MHWRender::MUIDrawManager& drawMgr, const MHWRender::MFrameContext& context)
{
if (event.mouseButton() != MEvent::kLeftMouse ||
!event.isModifierNone() )
return MS::kFailure;
MPxTexContext::doDrag(event, drawMgr, context);
short x, y;
event.getPosition( x, y );
fLastScreenPoint = fCurrentScreenPoint;
fCurrentScreenPoint = MPoint( x, y );
double xView, yView;
portToView(x, y, xView, yView); // pos at viewrect coordinate
fLastPoint = fCurrentPoint;
fCurrentPoint = MPoint( xView, yView, 0.0 );
if( fDragMode == kBrushSize )
{
double dis = fCurrentScreenPoint.distanceTo( fLastScreenPoint );
if ( fCurrentScreenPoint[0] > fLastScreenPoint[0] )
setSize( size() + float(dis) );
else
setSize( std::max( size() - float(dis), 0.01f ) );
}
else
{
fBrushCenterScreenPoint = MPoint( x, y );
MFloatArray uUVsExported;
MFloatArray vUVsExported;
const MVector vec = fCurrentPoint - fLastPoint;
if (!fCommand)
{
fCommand = (UVUpdateCommand *)(newToolCommand());
}
if (fCommand)
{
MFnMesh mesh(fDagPath);
MString currentUVSetName;
mesh.getCurrentUVSetName(currentUVSetName);
int nbUVs = mesh.numUVs(currentUVSetName);
MDoubleArray pinData;
MUintArray uvPinIds;
MDoubleArray fullPinData;
mesh.getPinUVs(uvPinIds, pinData, ¤tUVSetName);
int len = pinData.length();
fullPinData.setLength(nbUVs);
for (unsigned int i = 0; i < nbUVs; i++) {
fullPinData[i] = 0.0;
}
while( len-- > 0 ) {
fullPinData[uvPinIds[len]] = pinData[len];
}
MFloatArray uValues;
MFloatArray vValues;
float pinWeight = 0;
for (unsigned int i = 0; i < fCollectedUVs.length(); ++i)
{
float u, v;
MStatus bGetUV = mesh.getUV(fCollectedUVs[i], u, v, ¤tUVSetName);
if (bGetUV == MS::kSuccess)
{
pinWeight = fullPinData[fCollectedUVs[i]];
u += (float)vec[0]*(1-pinWeight);
v += (float)vec[1]*(1-pinWeight);
uValues.append( u );
vValues.append( v );
}
}
fCommand->setUVs( mesh.object(), fCollectedUVs, uValues, vValues, ¤tUVSetName );
}
}
return MS::kSuccess;
}