Page 2 of 2

Posted: Thu Aug 18, 2011 7:30 am
by Breinmeester
Brilliant! I'm gonna try it out. Thanks a lot!!

Posted: Thu Aug 18, 2011 7:37 am
by Breinmeester
One more thing: since it's realtime, I need to embed the script on a layer. I guess it's best to check for a MouseEvent and keep the scratchpad alive on mouse down and delete it on mouse release.

What's the code for checking if the left mouse button is down?

I could only find:

Code: Select all

class MouseEvent {
	MohoView	*view;

	LM_Point	pt;
	LM_Point	startPt;
	LM_Vector2	vec;
	LM_Vector2	startVec;
	bool		shiftKey;
	bool		ctrlKey;
	bool		altKey;
	real		penPressure;
};

Posted: Thu Aug 18, 2011 8:06 am
by Rudiger
I don't think there's a way to receive mouse events from an embedded script. Perhaps you could implement your script as a tool instead. Then you can specify the functions Tool:OnMouseDown(moho, mouseEvent), Tool:OnMouseMoved(moho, mouseEvent)), and Tool:OnMouseUp(moho, mouseEvent).


Not sure exactly what you're trying to do, but you might not even need to use a tool to detect mouseEvents since embedded scripts always update after every event.

Posted: Mon Aug 22, 2011 10:06 am
by Breinmeester
Ok, I've tried Rudiger's 'scratchpad' idea, but it wasn't ideal and I've found a way to do without it.

But I still want to implement this idea:
Breinmeester wrote:Maybe I could make an action called "delete" where it has keys on all the channels that need keys deleted for the parent and all child layers. This way the script could check if there's a key on a certain channel of the "delete" action and delete keys of the corresponding channel on the main timeline for the current frame.
I think it would be best to store where the "delete" action has keys in an array, so I can use that data to delete keys over multiple frames.
But how would I go about that? Remember that the action is on a group layer and effects several sublayers.

Anyone any good ideas?

blend morph interface

Posted: Fri Sep 30, 2011 9:24 pm
by chucky
I'm not really sure what you guys are doing here,
( I have to assume you are getting rid of all the unwanted and interfering keyframes)
but one thing that I find super annoying when using blend morph is the opening and closing of the blend morph dialogue box.
I noticed that Ramon Lopez ( the lost layer maestro ) is participating here so I am curious if there has been any similar enhancement to the BM's dialogue functionality ( or lack thereof )?
The lost layer's tool treatment is so brilliant, I couldn't bear to be without it.
I hope to see more tool enhancements like it 9 hopefully by SM who should really be more on the ball when it comes to implementation of the tools they develop (blend morph's having great potential but is stymied by s klutzy gooey).

Posted: Sat Oct 01, 2011 3:23 am
by Breinmeester
I got this to work. I'm using Rudiger's code mentioned on the first page to blend between multiple actions (in my case 4 actions), with calculated weights, through code, so without using the blendmorph dialogue box.
My actions are on group layers and effect some of their child layers. With the blendmorph code planting keyframes, I needed a way to delete the right keys if you wanted to undo a blend. So what I did was I created an action called 'delete' that holds keys on all the channels of all the layers that need keys deleted. Then, when you press the custom delete button, the script looks at where the 'delete' action holds keys and deletes keys on the same layers and channels on the current frame or over a given time frame.

Posted: Fri Feb 03, 2012 11:14 am
by Breinmeester
Just a note: the BlendActions command has become a lot faster since ASpro 8, which makes my script now a breeze to work with. My thanks go out to the Lost Marble team.