Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Chet

Pages: [1]
1
General / Re: Dot going out of the canvas.
« on: June 04, 2018, 08:59:25 pm »
Any good sources to learn debugging with Code::Blocks

Seems Google is broken for just you so here's some debugging links to help you until Google starts working again.

http://wiki.codeblocks.org/index.php/Debugging_with_Code::Blocks


https://rubberduckdebugging.com/
https://ericlippert.com/2014/03/05/how-to-debug-small-programs/

2
General / Re: Dot going out of the canvas.
« on: June 03, 2018, 10:41:26 pm »
Any idea how to fix the problem?

Yes. Use a debugger.

3
SFML projects / Re: Animation Creation, Editing, and Playback LIbrary
« on: June 03, 2018, 09:02:08 pm »
I found some time to make a few updates...

  • At the lower level Coordinate, Size, Point, Anchor, and Scale were reduced to a single template implementation taking both a type and a tag argument.
  • The keyframe has been split into 3 distinct types (pending reducing down to two). A basic key frame, a temporal keyframe, and a spacial keyframe. All keyframes have temporal curves but only a few have spacial curves. The basic keyframe and temporal are being merged together.
  • The temporal and spacial keyframes contain input and output arguments for the curve. These were originally contained in the interpolators but have been moved into the keyframe. The original implementation put the input argument of a keyframe in the keyframe that comes before it - terrible idea!
  • The functionality in property timeline has been split into a keyframe map (container adapter - mostly), basic property timeline, temporal property timeline and spacial property timeline. Like the keyframe the basic timeline and temporal timeline will be merged.
  • The Ellipse and Spline interpolators have been removed. Their functionality will be replaced by some type of expression that can be attached to the keyframe.
  • Removed serialization code (unnecessary at this point)
  • Added a very basic brute force loader for HitFilm project files. It supports static images (image sequences are next), compositions, layers, and the primary transform properties (angle, opacity, position, etc.). Spacial properties support constant, linear, and bezier curves. Temporal properties only support constant linear at the until I can swap out entire curve code. It supports enough features that I've eliminated the demo code in favor of using HitFilm projects. It _could_ support HitFilm composition shot files I just haven't gotten to it.

I'm going to clean up the code this afternoon and push it to github along with some additional videos to YouTube.

4
General / Re: Dot going out of the canvas.
« on: June 03, 2018, 06:13:22 pm »
Also btw turning the vector of circleShapes into a vector of circleShape pointers causes the program to crash when using the push_back method.

Sounds like more undefined behavior. Chances are the original vector is being destroyed causing the CircleShape objects to be destroyed which invalidates the pointers in your new vector.


I suggest you learn how to properly use a debugger to help identify the source of these problems.

5
General / Re: Dot going out of the canvas.
« on: June 03, 2018, 06:10:55 pm »
So inside the if(event.type == sf::MouseButtonPressed) i need a second if that checks if its a left or right click?

This code...
if(event.type == sf::Event::MouseButtonPressed && event.key.code == sf::Mouse::Right)

should be...

if(event.type == sf::Event::MouseButtonPressed && event.mouseButton.button == sf::Mouse::Right)

6
General / Re: Dot going out of the canvas.
« on: June 03, 2018, 05:00:27 pm »
This is because your bounds checking is incomplete. You are checking if the mouse coordinates are within the bounds of the canvas then drawing them - that's good. The bad part is that when you draw the do you do so from the upper left hand corner of the circle. When you do this on the right or bottom edge the dot will be drawn over the edge.

To fix this just take into account the size of the dot when you determine if the it can be placed on the canvas. If your dot is 10 pixels you shouldn't place the dot unless it's within getGlobalBounds() - dotSize.

Now as to your other problems...

What wrong Field am I  calling?

In the following code the event is a mouse button press but you are also checking they key code from a keypress event. Since sf::Event is a union accessing anything other than the last member set (written to) results in undefined behavior.
           if(event.type == sf::Event::MouseButtonPressed && event.key.code == sf::Mouse::Right)

You need to handle the key press event separately and maintain a flag that tracks if a certain key is pressed or not pressed so you can check it during other events.

You should actually be checking the event.mouseButton.button member instead of event.key.code. (read the documentation).

I know that using namespace std; is a bad practice, but for the time being it's not interfiering with anything so it's fine.

If you know that it's wrong why do you do it? I'l never understand why people take this poor approach to software development.

Also one last question is it possible to give a CircleShape pointer to the draw function in RenderWindow?

The draw function takes a reference not a pointer. Call it like so
                window.draw(**it);


7

You only show tge scene itself in the video, what does the "editor" look like?

Thanks! There is no editor. During the development of the PoC I switched to using HitFilm Express for authoring. The XML was imported into another tool and animations were produced in the PoC as well as other libraries I was working on. Everything in the video was done programatically and the code is included in the snapshot.

I'm hoping to find the import code I wrote for it so I can throw it in there was well.

8
SFML projects / Animation Creation, Editing, and Playback LIbrary
« on: May 15, 2018, 05:50:45 am »
A couple years ago I created a quick proof of concept to different aspects of putting together a package to handle key frame based animations much like you can do with tools like After Effects and HitFilm. It has basic support for assets, footage, layers, and compositions along with linear, Bezier, ellipse, and spline (incomplete) path interpolation.

The code is fairly rudimentary and a bit incomplete but I figured someone else might find it useful. Since it was created as a PoC there are quite a few things that could be done a lot more effectively if some time was spent sanitizing it a bit more. Iv'e attached a snapshot of the source in case anyone is interested.

Sample playback:




Some general details.

Project files are for VS2017.
Built and tested on SFML 2.4.2 (should work on 2.5)
SFML library should be dropped into externals/SFML or change the solution macro SFMLDir to point to the location containing your copy of SFML.
Build with modern C++.
Includes test/examples.
Intended more for authoring content. Playback in games would be handled a bit more efficiently.
Modeled after concepts common in applications in HitFilm and Adobe After Effects.
Includes bugs so there's no need to buy your own.


Emjoy!


I'll push this to GitHub when I get some free time.

Pages: [1]
anything