Looking for a way to modify “Link” action

K, lets proceed to the next stage – find a way to insert additional converts in special cases at the moment of invoking “Link” command.

First of all I’ve looked to commit introducing “Link to Bline” feature. There’s a lot things there I’ll need for 3rd stage, i.e. adding new context menu item:

diff --git a/synfig-studio/trunk/src/synfigapp/action.cpp b/synfig-studio/trunk/src/synfigapp/action.cpp
@@ -180,11 +183,13 @@ Action::Main::Main()
 ADD_ACTION(Action::ValueDescConnect)
 ADD_ACTION(Action::ValueDescDisconnect);
 ADD_ACTION(Action::ValueDescLink);
+       ADD_ACTION(Action::ValueDescBLineLink);

But for now most of my attention attracted creation of synfig-studio/trunk/src/synfigapp/actions/valuedescblinelink.cpp. Looks like everything I need resides in synfig-studio/trunk/src/synfigapp/actions/. I’m looked at the valuedesclink.cpp – it seems responsible for “Link” menu entry in context menu, I figured it out from that lines:

/* === M A C R O S ========================================================= */

ACTION_INIT(Action::ValueDescLink);
ACTION_SET_NAME(Action::ValueDescLink,"ValueDescLink");
ACTION_SET_LOCAL_NAME(Action::ValueDescLink,N_("Link"));
<pre>

There’s also valuenodelinkconnect.cpp file there, but that’s probably not what we want, because we need duck on the workarea (ValueDesc), not parameter on Param panel (ValueNode).

Now I need to closely inspect valuedescblinelink.cpp and valuedesclink.cpp to figure out how to:

  • detect what linked ducks are tangents;
  • get tangent type (“red” or “yellow”);
  • insert additional converts for special case (linking “red” and “yellow”).
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: