Mouse CHOP (draw in the orthagonal viewport?)

   2719   7   2
User Avatar
Member
245 posts
Joined: 9月 2008
Offline
Hi. I noticed there is a mouse chop which allows for input of XY data while the mouse is active anywhere in the HOUDINI window.

I'm wondering if there is a way to “paint” or draw a series of points? I am missing something about the Trail SOPs inherent functionality and I think it could be used to create what I want.

Can anyone help me out with this?

P.S. I tried using an Add SOP with one point at 0,0,0 and piping that into a Trail SOP but it didn't work as I had expected. There must be a way to paint points into the viewport to create a naturally drawn curve.
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
Uhmmm I think there may be a python function under sceneview module which can return a 3d location under the mouse, which you can use to feed into a curve sop. However, have you tried using the stroke sop? It does exactly what you are describing
-G
User Avatar
Member
245 posts
Joined: 9月 2008
Offline
So you're saying that if I just wanted 2D information to be drawn I could pipe a python SOP directly into a curve SOP and get what I'm looking for with the Mouse CHOP?

Thanks for the info about the Stroke SOP. I also found an OTL called the drawCurve SOP which is a more complex approach to the Stroke SOP and actually has a Stroke SOP in it somewhere in the network.

Cheers.
User Avatar
Member
245 posts
Joined: 9月 2008
Offline
Granted I've never had to do anything very complex in all the years of using Houdini. However I do not know how to use Python in a Houdini workflow. How would I go about doing that with a Python SOP if that's the way to go? Do you have an example file? Or a screenshot? Thanks in advance.

P.S. The reason I think the MOUSE CHOP might be the way to go is for a live interaction type of thing. Also the Mouse CHOP allows one to enable the “use tablet” option for things requiring pressure sensitivity and other parameters that a good tablet can offer.
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
I myself did not write a script, but a friend of mine did a LONG time ago. Take a look at hou.GeometryViewport (which you can return if you have the hou.SceneViewer object);

http://www.sidefx.com/docs/houdini14.0/hom/hou/GeometryViewport [sidefx.com]

there is a few classes in there to transform the mouse CHOP coordinates to viewport coordinates, then from there to world coordinates as well as return what is under the mouse. I think my friend wrote a script where he would have a sphere follow his mouse

In theory, you could potentially use that information to build a detail attribute string (I think) which could be referenced by a curve SOP.
-G
User Avatar
Member
245 posts
Joined: 9月 2008
Offline
Thanks. That info page is very useful IF i knew Python. But I have searched for it and there is plenty of information on how to learn Python so once I have some time I will try to wrangle it.

I am elated that you took the time to respond to my query with something valuable. I thank you for that.
User Avatar
スタッフ
6275 posts
Joined: 7月 2005
Online
While it is possible to do this with the Mouse CHOP, I'd recommend looking at the Stroke SOP as it likely has the building blocks you need.
User Avatar
Member
245 posts
Joined: 9月 2008
Offline
You're absolutely right! I just looked at all the attributes created with the Stroke SOP and it allows for all of the tablet options if I were to use a pressure-sensitive tablet.
  • Quick Links