diff --git a/SeamsEasyNode.cpp b/SeamsEasyNode.cpp index 4768aa4..b0bb279 100644 --- a/SeamsEasyNode.cpp +++ b/SeamsEasyNode.cpp @@ -255,13 +255,13 @@ MStatus SeamsEasyNode::compute(const MPlug &plug, MDataBlock &dataBlock) { return MS::kUnknownParameter; // Load attribs /////////////////////////////////////////////////////////////////////////////// - if (dirtyMesh) { + if (dirtyMesh || m_sourceMesh.isNull()) { MObject sourceMesh = dataBlock.inputValue(aInMesh).asMesh(); if (m_sourceMesh.isNull() || !SMesh::isEquivalent(sourceMesh, m_sourceMesh)) dirtyBaseMesh = true; m_sourceMesh = sourceMesh; } - if (dirtyComponent) { + if (dirtyComponent || m_component.isNull()) { dirtyBaseMesh = true; dirtyComponent = false; MObject oSeamsEasyData = dataBlock.inputValue(aSelectedEdges).data(); @@ -448,7 +448,8 @@ MStatus SeamsEasyNode::compute(const MPlug &plug, MDataBlock &dataBlock) { CHECK_MSTATUS_AND_RETURN_IT(status); } - dataBlock.outputValue(aOutMesh).set(extrudeMesh.getObject()); + status = dataBlock.outputValue(aOutMesh).set(extrudeMesh.getObject()); + CHECK_MSTATUS_AND_RETURN_IT(status); dataBlock.setClean(aOutMesh); return MS::kSuccess; diff --git a/StitchEasyNode.cpp b/StitchEasyNode.cpp index f9df6e0..2c81577 100644 --- a/StitchEasyNode.cpp +++ b/StitchEasyNode.cpp @@ -247,25 +247,22 @@ MStatus StitchEasyNode::compute(const MPlug &plug, MDataBlock &datablock) { if (plug != aOutMesh) return MS::kUnknownParameter; - if (m_dirtySourceMesh) { + if (m_dirtySourceMesh || m_sourceMesh.isNull()) { MObject sourceMesh = datablock.inputValue(aInMesh).asMesh(); if (m_sourceMesh.isNull() || !SMesh::isEquivalent(sourceMesh, m_sourceMesh)) m_dirtyBaseMesh = true; m_sourceMesh = sourceMesh; } - if (m_dirtyComponent) { + if (m_dirtyComponent || m_component.isNull()) { m_dirtyBaseMesh = true; m_dirtyComponent = false; MObject stichLineData = datablock.inputValue(aStitchLines).data(); MFnComponentListData compListData(stichLineData, &status); CHECK_MSTATUS_AND_RETURN_IT(status); - if(!compListData[0].isNull()) - m_component = compListData[0]; + m_component = compListData[0]; } if (m_component.apiType() != MFn::kMeshEdgeComponent || m_sourceMesh.isNull()) return MS::kInvalidParameter; - - cout << m_component.isNull() << endl; if (m_dirtySourceMesh || m_dirtyBaseMesh) { m_dirtySourceMesh = false;