Page MenuHome

OpenGL: convert anim_channel_defines.c to new imm mode
ClosedPublic

Authored by Benjamin Summerton (define-private-public) on Nov 24 2016, 5:07 AM.

Diff Detail

Repository
rB Blender
Branch
imm.anim_channel_defines.c
Build Status
Buildable 303
Build 303: arc lint + arc unit

Event Timeline

Benjamin Summerton (define-private-public) retitled this revision from to This should move over anim_channel_defines.c. Please checke the notes for some of my comments..Nov 24 2016, 5:07 AM

So this was a pretty simple fix over. I wasn't able to test it (yes I know, I'm a bad person) because I don't really know where it's used in the program, or how to bring up the code. I tried tracing it, but I couldn't get functions like acf_generic_channel_backdrop() to be called. If someone knows how to do that, please tell me.

Also, there are still two deprecated OpenGL calls (glColor3f() and glLineWidth()). Check lines 3848 through 3851 for this. That color call is being used for fdrawline() (found in glutil.c). I could very simply replace it (since it's a 4 liner), but I did noticed that fdrawline() was marked to be deprecated. What should I do here? I really want get rid of those old OpenGL functions, but I could use your advice before proceding.

As a general way to trace functions in code I use find in files from IDE or a "grep -r" from command line. In this case it's slightly harder because those functions are used by function pointer. Still find in files shows them being setup in several bAnimChannelType, looking at definition of bAnimChannelType in ED_anim_api.h you can see the function pointer name is draw_backdrop. Searching for draw_backdrop shows it's called from ANIM_channel_draw, and ANIM_channel_draw is called from action, nla, and graph editors draw code.

To get these functions to be called just switch to one of those editors and add some keyframes to default cube.

So far it seems that we are just replacing *drawline functions by expanding to regular draw calls, so just replace with immBegin, two immVertex, and a immEnd.

It's ok to leave glLineWidth -- wide lines are still available in GL core profile and Vulkan. We'll just have to check at startup (once) the supported range of widths.

Yep, calls to fdrawline should be replaced by Begin,Vertex,Vertex,End.

  • Moved over an fdrawline() call

Updating D2377: This should move over anim_channel_defines.c. Please checke the notes

for some of my comments.

@Anthony Edlin (krash) : I usually do that grep -rn ... thing to trace function calls, but this one was a little more difficult for me. Thanks,

This should be good to go. I tested the first two replacements and they were fine. I was having some difficulty trying to find the one for the frdawline() replacement I made, so that isn't tested. Does someone know how to get that code called so I can verify it? I'm having some trouble finding it on my own.

Mike Erwin (merwin) retitled this revision from This should move over anim_channel_defines.c. Please checke the notes for some of my comments. to OpenGL: convert anim_channel_defines.c to new imm mode.Jan 16 2017, 6:03 AM
Mike Erwin (merwin) accepted this revision.
This revision is now accepted and ready to land.Jan 16 2017, 6:17 AM

Landed in blender2.8 — woohoo!