A plugin origin to the center of object

Here a plugin which will set it’s origin to center for all layers which will have bline and origin (doesn’t support groups yet)

Set the orgin to center.zip (3.8 KB)

Extract the zip file and then move it to your plugins directory . Restart Synfig and you can see the option in plugin menu “Center the Origin”.

This will center the origin. This is based on position of vertices the center is calculated by where the vertices are. Considering a imaginary rectangle around that object the midpoint is calculated for diagonal which will be the center of object. This technique has few limitations which I will fix, and the updates will be on this thread.

Any suggestions are greatly appreciated

1 Like

An update to the plugin !

Now supports group layer centers the group layer origin.

Set the origin to center.zip (4.1 KB)

Now centers all the shapes and group layers origin. If you find any bugs then please tell me, if possible provide the screenshot of error shown if something goes wrong. Or the sif file you are working with. And help would be appreciated.

4 Likes

I’ve got an odd bug. When the Synfig file is on my desktop, the plugin works. But when I move the file (or create a new one) on, for example, D drive, the plugin gives an error:

obraz

The name of my file is: “Synfig Animation 1”. There’s no “89B33E46” string in the name.

Sadly, the problem may be the non-ASCII letters of the folder.
It shouldn’t happen though. Can you move it to a name without any diacritics (like “ó”) ?
By the way, what Synfig version do you use? Is it 1.4.2?

That suffix is automatically appended to not directly overwrite the currently open file. Don’t worry.

You were right - Polish letters were the problem - that’s the charm of living in middle Europe…
I’m currently using Synfig in version 1.4.2

1 Like

Please try development version 1.5.0 to check if it works on such folder name.

Plugin update!

Plugin: center-the-origin.zip (1.9 KB)

  • Goes deep within a nested group, previously only groups at the top level were evaluated
End

Hopefully this is final version of plugin, no more updates to this.

The Goal of the plugin, was that it centers the origin (parameter), before you begin to animate things. So this plugin is post processing after you export .sif file from Inkscape

I am open to make minor changes or other bug fixes.

Things out of scope for plugins are:
This plugin doesn’t consider the shapes of curves, may not work properly when a group has transformations within them. I haven’t even tested what happens when you have animated origin or offset (group), doesn’t consider things like transformation layers such as translate, scale, etc.

Centering the origin has been a really important process in making my 100 Animations :nerd_face:, I would like to implement this feature natively in Synfig which would allow me to take advantage of Bounding Box :+1: that is already drawn.

2 Likes