Skip to content

Commit

Permalink
Start by cleaning up all the type conversion warnings and Remove unus…
Browse files Browse the repository at this point in the history
…ed variables
  • Loading branch information
tbttfox committed Aug 22, 2024
1 parent ee8553a commit 8168d5d
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 101 deletions.
8 changes: 3 additions & 5 deletions src/drawOverride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ void TwistSplineGeometryOverride::addUIDrawables(
drawManager.beginDrawable(MUIDrawManager::kSelectable);

if (splineDraw) {
MHWRender::DisplayStatus displayStatus =
MHWRender::MGeometryUtilities::displayStatus(path);
MColor color = MHWRender::MGeometryUtilities::wireframeColor(path);
drawManager.setColor(color);
drawManager.lineStrip(splinePoints, draw2D);
Expand All @@ -115,7 +113,7 @@ void TwistSplineGeometryOverride::addUIDrawables(
MPointArray tangents;
MVectorArray tans = splineData->getTangents();
tangents.setLength(tans.length() * 2);
for (size_t i = 0; i < tans.length(); ++i) {
for (unsigned i = 0; i < tans.length(); ++i) {
MPoint& spi = splinePoints[i];
tangents[2 * i] = spi;
tangents[(2 * i) + 1] = debugScale * tans[i] + spi;
Expand All @@ -126,7 +124,7 @@ void TwistSplineGeometryOverride::addUIDrawables(
MPointArray normals;
MVectorArray norms = splineData->getNormals();
normals.setLength(norms.length() * 2);
for (size_t i = 0; i < norms.length(); ++i) {
for (unsigned i = 0; i < norms.length(); ++i) {
MPoint& spi = splinePoints[i];
MVector& nn = norms[i];
normals[2 * i] = spi;
Expand All @@ -138,7 +136,7 @@ void TwistSplineGeometryOverride::addUIDrawables(
MPointArray binormals;
MVectorArray binorms = splineData->getBinormals();
binormals.setLength(binorms.length() * 2);
for (size_t i = 0; i < binorms.length(); ++i) {
for (unsigned i = 0; i < binorms.length(); ++i) {
MPoint& spi = splinePoints[i];
binormals[2 * i] = spi;
binormals[(2 * i) + 1] = debugScale * binorms[i] + spi;
Expand Down
2 changes: 1 addition & 1 deletion src/riderConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ MStatus riderConstraint::compute(const MPlug& plug, MDataBlock& data) {
MArrayDataBuilder builder = outHandle.builder();
for (size_t pIdx = 0; pIdx < params.size(); ++pIdx) {

MDataHandle outH = builder.addElement(pIdx);
MDataHandle outH = builder.addElement(static_cast<unsigned>(pIdx));
MDataHandle tranH = outH.child(aTranslate);
MDataHandle rotH = outH.child(aRotate);
MDataHandle sclH = outH.child(aScale);
Expand Down
11 changes: 6 additions & 5 deletions src/twistMultiTangentNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,14 +542,15 @@ MStatus TwistMultiTangentNode::compute(const MPlug &plug, MDataBlock &data)

// Read everything
MArrayDataHandle vertInputs = data.inputArrayValue(aVertData);
unsigned int icount = vertInputs.elementCount();
unsigned icount = vertInputs.elementCount();

double startTension = data.inputValue(aStartTension).asDouble();
double endTension = data.inputValue(aEndTension).asDouble();
int maxVertices = data.inputValue(aMaxVertices).asInt();
int rawMaxVertices = data.inputValue(aMaxVertices).asInt();
unsigned maxVertices = rawMaxVertices < 0 ? 0 : static_cast<unsigned>(rawMaxVertices);
bool closed = data.inputValue(aClosed).asBool();

icount = (icount < maxVertices) ? icount : (unsigned int)maxVertices;
icount = (icount < maxVertices) ? icount : static_cast<unsigned> (maxVertices);
if (icount < 2) {
data.setClean(aInTan);
data.setClean(aInTanLen);
Expand All @@ -574,7 +575,7 @@ MStatus TwistMultiTangentNode::compute(const MPlug &plug, MDataBlock &data)
// Don't care which plug I'm being asked for. Just compute all of 'em
std::vector<TanData> tanData;

for (size_t i = 0; i < icount; ++i) {
for (unsigned i = 0; i < icount; ++i) {
TanData dat;

vertInputs.jumpToArrayElement(i);
Expand Down Expand Up @@ -633,7 +634,7 @@ MStatus TwistMultiTangentNode::compute(const MPlug &plug, MDataBlock &data)
auto outputs = data.outputArrayValue(aTangents);
auto builder = outputs.builder();
for (size_t i = 0; i < tanData.size(); ++i) {
auto outHandle = builder.addElement(i);
auto outHandle = builder.addElement(static_cast<unsigned>(i));
auto &cur = tanData[i];

auto inTanHandle = outHandle.child(aInTan);
Expand Down
Loading

0 comments on commit 8168d5d

Please sign in to comment.