Sketching with mouse events ?

   3891   5   0
User Avatar
Member
25 posts
Joined: Feb. 2010
Offline
Hi,

I want to create a sketching interface for Houdini. I think the way to go is to create an event handler but I'm not sure where to start.

I want to create a tool that could be activated in Houdini and which will records mouse button events and mouse moves in order to paint curves inside the viewport. ( I want to record the mouse position when the left mouse button is pressed and use the recorded positions to draw a curve in the viewport)

I was looking for the event handler in the HDK but I cannot find a lot of informaiton on it. I found the MSS_CustomBrushState in the samples files. It looks like if I use it as a template (that's means inherite from MSS_singleOpState) I can handle mouse events and records mouse position and apply some computation on the records… but

My knowledge in Houdini are still in progress and my knowledge in the HDK is NULL.

Before to start playing around withg the code and testing my ideas, I prefer to get your gourou advices…

Leave comments if you think this is the way to go or if you think I miss a point. Moreover, if you already have some solutions similar, I'm really interested to see them or to get your advices.

Thank you for reading

Nicolas
User Avatar
Member
33 posts
Joined: May 2006
Offline
believe it or not your answer lies in CHOPS.
User Avatar
Member
25 posts
Joined: Feb. 2010
Offline
Could you detail please.

It was my first idea but I look for mouse input in chop and it only give me some mouse coordinates in screen space.
Is there an other node to get the mouse button status?

and after that, how did you project this coordinates into your scene ( with 2 screen if I remenber the coordiantes are from -1 to 3 in tx)
User Avatar
Member
33 posts
Joined: May 2006
Offline
Ok you are gonna need some sops: the paint sop should work for this. The very last folder is a “stroke”, and it contains a “mouse event”, and a whole lot of other yummy goodness……….

Note: the sculpt node has the same folder.
Note: Trigger chop on mouse events,……..are we getting warm or what!…..
User Avatar
Member
25 posts
Joined: Feb. 2010
Offline
We are getting warm…

The trouble with this solution is that I need a geometry to paint on.
I want to use my solution to squetch points when there is nothing in the scene.
I think I will create a plane to paint on, oriented with the construction plane or the camera.

But if you have some idea to do it like the object creation (the box projected in the scene that show where the object will be…) it could be better.


Thanks, you already help me a lot
User Avatar
Member
33 posts
Joined: May 2006
Offline
Dont you need a “node” inside the “geo1”, to give houdini a sense of direction??
  • Quick Links