Skip to content

Fix 208, fix vertex click, misc. upgrades#209

Open
megapatato wants to merge 10 commits into
niftools:developfrom
megapatato:develop
Open

Fix 208, fix vertex click, misc. upgrades#209
megapatato wants to merge 10 commits into
niftools:developfrom
megapatato:develop

Conversation

@megapatato
Copy link
Copy Markdown

Fixes #208

Enhances the vertex click operation.

Adds a vertex color painting mode.

hmedina and others added 8 commits October 26, 2021 17:49
The interpolation request declares a type "T", which will be used in the
getter methods. When "value" is a Vector3, the getters will get
Vector3s; when "value" is a float, the getters will get floats. This
procedure therefore works with 3D interpolation (e.g. translocation)
as well as 1D interpolation (e.g. scale).
Refine paint vertex controls dock panel
Fix several bugs with setting viewports to the wrong size on high DPI devices
More accurate documentation of the tangents in the Hermite cubic interpolation.
Copy link
Copy Markdown
Member

@neomonkeus neomonkeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work.
(Un)fortunately been many years since I looked at C++, and nifskope tbf so can only provide cursory input. Only some weird formatting issues and minor comments.

Comment thread src/data/niftypes.h Outdated

friend class NifIStream;
friend class NifOStream;
friend class ByteColor4;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting issue here

Comment thread src/gl/bsshape.cpp
if ( Node::SELECTING ) {
if ( scene->selMode & Scene::SelObject ) {
if ( scene->actionMode & Scene::Object ) {
int s_nodeId = ID2COLORKEY( nodeId );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting seems to be all over the shop here.

Comment thread src/gl/glcontroller.cpp
a straight line.
*/

// Tangent 1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread src/gl/glcontroller.cpp Outdated
setting v1's corresponding "Backward" value to 1 and v2's
corresponding "Forward" to 1 results in a linear interpolation.
*/
Interpolate X, Y, and Z values independently, along a segment between
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 for improving docs

Comment thread src/glview.cpp Outdated
glDepthFunc( GL_ALWAYS );
glLineWidth( 2.0f );
glColor3f( 1.0, 0.0, 0.0 );
//drawCircle(Vector3(0, 0, 0), Vector3(0,0,1), 0.2);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code.

Comment thread src/glview.cpp Outdated
// Resize viewport to small corner of screen
int axesSize = std::min( width() / 10, 125 );
glViewport( 0, 0, axesSize, axesSize );
glViewport( 0, 0, axesSize*devicePixelRatioF(), axesSize*devicePixelRatioF() );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting around operands.

Comment thread src/glview.cpp Outdated

if (cfg.vertexPaintSettings.brushMode == PaintBlendMode::BlendNormal)
{
blend = (cfg.vertexPaintSettings.brushColor * cfg.vertexPaintSettings.brushOpacity) + (base * (Color4() - cfg.vertexPaintSettings.brushOpacity));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(cfg.vertexPaintSettings.brushColor * cfg.vertexPaintSettings.brushOpacity) can be pulled outside of the for loop.
Could also assign cfg.vertexPaintSettings.brushOpacity to a variable as used in a few locations aswell.

Comment thread src/ui/widgets/vertexpaintwidget.cpp Outdated
value_.brushSize = (float)ui->brushSize->value();

float opacity = (float)ui->opacity->value() / 255.0f;
if (ui->opacityMode->currentIndex() == 0) // Color only
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on moving these ints as to const modes rather than magic numbers?

Comment thread src/ui/widgets/vertexpaintwidget.cpp Outdated

void PaintSettingsWidget::showColorPicker()
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything required here?

Comment thread src/ui/widgets/vertexpaintwidget.cpp Outdated
int g = colorDoubleToInt(ui->colorG->value());
int b = colorDoubleToInt(ui->colorB->value());
int a = colorDoubleToInt(ui->colorA->value());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here as feel there is something iteresting going on 😵‍💫

Address minor PR comments
@DonkeyKong
Copy link
Copy Markdown

Thanks for the feedback. I've normalized the whitespace in all files touched by this PR to use tabs (whoops), and addressed all your comments.

@neomonkeus neomonkeus self-assigned this Feb 4, 2022
Copy link
Copy Markdown
Member

@neomonkeus neomonkeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@hexabits
Copy link
Copy Markdown
Member

I need to look through this still, but also will need to compare it against my dev8 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quadratic key interpolation ignores derivatives

4 participants