Page MenuHome

Customize style for animation motion paths
AbandonedPublic

Authored by Antonio Vazquez (antoniov) on Mar 24 2016, 6:13 PM.

Details

Summary

Currently, the visualization of motion paths only allows the default theme color, but this is limited and sometimes is difficult to see.

The patch allows to change the color of any motion path to better visualization and/or color organization. It is also possible to change line thickness or draw points only to check spacing.

https://youtu.be/lNxhYPVPoiI

Diff Detail

Event Timeline

Antonio Vazquez (antoniov) retitled this revision from to Custom style for motion paths.Mar 24 2016, 6:13 PM
Antonio Vazquez (antoniov) updated this object.
Antonio Vazquez (antoniov) updated this revision to Diff 6310.
Joshua Leung (aligorith) requested changes to this revision.

A good start, but a few things could be done differently/better :)

  1. "Lines" option - There's no reason why this should only apply when the "Custom Colors" option is enabled. I recommend including it with the other checkboxes, labelled "Show Lines" or "Draw Lines"
  1. "Line Thickness" - Again, this option should apply regardless of whether we enable "Custom Colors" or not
  1. When I put in the current color scheme, it was in response to animators requesting that they could tell which parts of the path occurred before and after the current frame. It would be interesting to see if it would be better to use a darker shade of the selected color before the current frame, and a lighter one for after. Another idea is to provide before/after colours, but that is perhaps getting too much.
source/blender/makesdna/DNA_action_types.h
91

Follow the style for the previous two defines - so, comment in the line above, and line up the ='s

source/blender/makesrna/intern/rna_animviz.c
160

Probably not needed

161

"Custom color for motion path"?

182

Call this "use_custom_color" instead?

The <code>is_</code> prefix is more suited to readonly properties, while <code>use_</code> seems to suggest that the option can be edited by users.

190

Tooltips should say what the option will do when enabled. It's clearer/easier to understand if you say "Draw path between keyframe points" or "Draw straight lines between keyframe points" instead of "disable to do not" (i.e. not not something)

See:
https://wiki.blender.org/index.php/Dev:Doc/Code_Style

This revision now requires changes to proceed.Mar 25 2016, 12:57 AM

About color before and after the frame, if we use the idea of getting darker/lighter approach...what happens if the color selected is the higher value, for example pure white? How we can make lighter the white?

Maybe a better solution is your idea of adding three colors, before-current-after. I don't think this is not too much for the UI if we put all of them in the same row with align=True. This is already used in bone group colors panel. What do you think?

About color before and after the frame, if we use the idea of getting darker/lighter approach...what happens if the color selected is the higher value, for example pure white? How we can make lighter the white?

In that case, it might be ok to just have 2 colors: white and a light gray

Maybe a better solution is your idea of adding three colors, before-current-after. I don't think this is not too much for the UI if we put all of them in the same row with align=True. This is already used in bone group colors panel. What do you think?

That's also doable. I just worry about ending up being too much trouble for animators to bother setting up all 3, when they just want to change the color on one path so that it stands out relative to the others.

We can go for a third option. Define only one color and use the complementary color (as I do now with the current frame) to fade in both sides. The interpolated color will be something between current color and complementary. With this we get a color hint in screen, but only one color to set.

Ok, that sounds interesting. Let's see :)

Here an example using complementary color automatically. The UI panel has been modified too. The calculation of the intensity is the same used when normal colors are used.

If you agree with the change, I can upload the new diff file.

New panel (It was not visible in previous image)

I think is better a compact panel, putting button and color in same row. Color is disabled if custom is not enabled.

I don't if it will be too much asking, if we put it in user pref with other themes so user can just save as default. What do you think?
I m already happy that you are making Motion Path better :)

The custom color is designed for allowing better visibility and to organize motion paths in viewport. If we define a "static" color in the theme, maybe in the scene this color is not visible, so we miss the point of custom color. Actually, the code generate the complementary color, so the user set the better color manually and the complementary always gets a good contrast.

So the complementary colour is just for the segment immediately after the current frame?

I'd be careful about trying to make it blend between the two. IMO, that turned out to be one of the problems causing visibility problems for the current paths, as it would always go through gray when interpolating between the colours. Perhaps there's some other fancy ways in OpenGL to control this with more accuracy?

I'm still not too convinced about this approach. Looking at it initially, it wasn't immediately obvious to me just looking at the paths what was going on without carefully inspecting the frame numbers.

Here's a paintover of what I was thinking about originally:

Antonio Vazquez (antoniov) updated this revision to Diff 6319.

Changed after code review. All changes have been done.

Antonio Vazquez (antoniov) marked 5 inline comments as done.Mar 26 2016, 4:35 PM

I have done some small changes to the interpolation and IMO now the next frame is very clear.

@Joshua, after running some test I agree with your idea, I will change the code to show your solution: darker color before frame and lighter color after.

Antonio Vazquez (antoniov) retitled this revision from Custom style for motion paths to Customize style for animation motion paths.Mar 28 2016, 1:40 PM
Antonio Vazquez (antoniov) edited edge metadata.
Antonio Vazquez (antoniov) updated this revision to Diff 6324.

Updated to show the previous frames, current frame and next frames with the same color, but using different intensity value.

Example with the latest color scheme:

@Antonio Vazquez (antoniov) - As in the other patch, a gentle reminder to follow the code style guidelines: https://wiki.blender.org/index.php/Dev:Doc/Code_Style


@Hjalti Hjálmarsson (hjalti) I'd be interested in hearing your feedback about the how well this patch works when animating :)

@Joshua: I will update the style...I'm working a lot of years with my "own" style and it's easy to make mistakes.

@hjalty: The performace must be the same that you have today. I only replaced colors and thicknes. No change in internal calculations.

This is brilliant, I have often had the headache of the paths being almost invisible in a busy scene and this give you the right tools to fix that yourself, based on your particular shot. I totally would like to see this in the master! :)

...my main issue with motion paths however is the snail-like speed but that's a totally different topic haha.

Great job!

Changes in code style (mainly braces and C comment style)

Any news about this patch? I tried to build with this patch i m getting some errors no such file ...

Can we have this in the master so more artists/ users will test?

Joshua Leung (aligorith) requested changes to this revision.

I finally got around to giving this a good round of testing. Here's an annotated screenshot noting some issues I found, and a few suggestions for what would make the UI better:

  1. Remove the theming/styling settings from the toolbar - These are properties of the data being shown, and not settings for how tools will behave when next used, so they shouldn't be here. (Also, as a side note, I noticed some weirdness here, with these settings getting shown after the Action/Bake in the "Animation" tab, when in Object Mode). So, recommend removing these from the toolbar completely.
  1. Move the "Show Lines" toggle to sit in the same column as "Frame Numbers" instead of leaving a gap there.
    • Rename "Show Lines" to "Lines" or "Line Segments"
    • Also, make sure the "Thickness" property is also in that column (without a gap between Show Lines and Thickness)
    • Make the Thickness property only be active for editing when the Show Lines option is enabled. (EDIT: Unless it still affects the point sizes when no lines are shown?)
  1. Move the "Keyframe..." options down one row, so that the first one is now in line with the "Frame Numbers" toggle
  1. Move the "Show Lines" and "Thickness" options to be in bAnimVizSettings - There's not that much benefit to making these changeable per-path IMO. You'd just end up giving animators more work trying to manage all their paths. These two settings also seem quite conceptually similar to the show frame number/keyframe settings, so having them behave differently (i.e. per path instead of for all) also seems a bit weird.
  1. Maybe this toggle needs a label after all? e.g. "Path Color"? (I was going to mention that it doesn't seem all that clear when the color is/isn't used, but I found that that is actually more of a problem with Blender's UI in general)

Anyway, this is almost there! Just a few more tweaks needed :)

This revision now requires changes to proceed.Apr 17 2016, 9:33 AM

About moving the color of the motion paths as a general setting I have some doubts. I have listened @Hjalty how he uses the colors to organize the animation. For example, if you are looking a character walking, maybe you want to see the motion of the pelvis, foot and torso and it's better to set 3 different colors and/or settings (lines, points, etc). Visually, if you can set by motion, you can organize better the motion visualization.

In the previous comment I refer to line settings, not only color. Display points, lines or thicker lines can be useful to separate motion paths in a crowded scene.

  1. Move the "Show Lines" and "Thickness" options to be in bAnimVizSettings - There's not that much benefit to making these changeable per-path IMO. You'd just end up giving animators more work trying to manage all their paths. These two settings also seem quite conceptually similar to the show frame number/keyframe settings, so having them behave differently (i.e. per path instead of for all) also seems a bit... <

IMO is sooo useful the "custom color" options, many times you have 3 or 4 motion paths in you scene to compare/check it and the custom color,thickness options make a lot more readable what is what in the viewport .

Hmm I see.... maybe this can be ok... I'll have another play around with this tomorrow :)

I have compiled this diff and played around with it. As a animator color per path is a good way to handle your animation. Here is a screenshot http://www.pasteall.org/pic/show.php?id=102004

I found a small something when open a old .blend file saved with motion path, this new feature act kind of strange. Doesn't create a path and does color only dots. deleting the curve and adding a new one solved the issue.

Since we are here (with motion path) may i ask to put motion path to act differently in different windows so we can enable visibility in a window and disable it in an other window like Relationship Lines . That will be just great.

@Erick Tukuniata (erickblender) thanks for the bug report. I think the problem is in the initializatio, so I need to add some code in vesioning_270.c.

Antonio Vazquez (antoniov) updated this revision to Diff 6527.

Update UI panel, remove from Tools panel and fix error when opening previous versions .blend files adding initialization code.

Hi there!

@Antonio Vazquez (antoniov) Since you have commit right can we have this in 2.79? Please :)

@Erick Tukuniata (erickblender) I'm not sure is good idea to include this patch in 2.79.

The idea is to change these things a lot in 2.8, so maybe this modification could be part of some more improvements in UI and viewport that will be implemented in 2.8 using new opengl version.

Anyway, I will keep a note to port these functions to 2.8.

@Antonio Vazquez (antoniov) I don't want to push you into it but we will have a long testing period before we can happily use 2.8, so if it is not to much asking many people will be happy to have this feature already into master. Anyway you are dev. you know better, up to you to decide :)

Antonio Vazquez (antoniov) edited edge metadata.EditedJan 19 2017, 5:56 PM
Antonio Vazquez (antoniov) updated this revision to Diff 8155.

Update initialization code to version 2.78.4 and make it ready to include in version 2.79.

@Joshua Leung (aligorith) could you review the patch? I did all the changes you proposed in the past. This diff is only an update to current version.

I tested this again just now, and overall I think it should be fine to include :)

There's just one weird thing I noticed with the way it's currently colouring the paths around the current frame:


It's not that clear what's supposed to be happening here - is that middle point where the current frame is, or should all three points be surrounded by green?

Also, IIRC we used to indicate the vertex corresponding to the current frame on each path (using the green "current frame" color). It would be nice to see this or something similar back again (especially if/when you're dealing with wireframes)

source/blender/editors/space_view3d/drawanimviz.c
278

For multiline conditionals, the brace should be on a new line (as before), instead of being at the end of the condition

Thanks @Joshua Leung (aligorith).

I have fixed the style of the brace.

About the strange color, for default color, the code is the same that was used before, When the custom is enabled, I was unable to reproduce the problem and color worked fine.

I'm going to apply the patch and later we can improve it if we found any bug, but I think the benefits worth to move to master. I will do a separate commit with the diff (I don't know how apply a differential directly)

Thank you guys,
Next time we meet in BConf, i will buy you a beer :)
You just made my day, yeah Blender rocks :)