How do you snap curve to grid in Unity?

   573   9   3
User Avatar
Member
26 posts
Joined: Jan. 2017
Offline
I am trying to figure out a way to snap the curve to Unity's grid. I tried going into the HoudiniCurveGUI script but I can't find anything that has to do with snapping. Does anyone know how to get this to work?
User Avatar
Staff
165 posts
Joined: May 2017
Offline
The best way to do that is to provide a collider (e.g. plane) to the Target field in the Curve gameobject's UI.

Actually you asked for snapping. Currently not possible with the curve editor, but I'll add it as an RFE.
Edited by seelan - Feb. 26, 2018 16:44:58

Attachments:
curve_collider.png (11.7 KB)

User Avatar
Member
193 posts
Joined: March 2006
Offline
Hi,
just ran into the same problem. Sticking the curve to a unity terrain. But I can't find the Houdini Curve (Script).
Thanks for help.

Detlef
User Avatar
Staff
165 posts
Joined: May 2017
Offline
You'll need to make the curve node editable for it to show up (i.e. add to Editable nodes in Type Properties).

And you can make the curve editing snap to terrain by either use the terrain collider or the setting the layer of the terrain in the curve's collision section. Specifically, change the Draw Collision Type to Layer, then set the layer of the terrain as the value.
https://www.sidefx.com/docs/unity/_curves.html#Curves_ParametersUI [www.sidefx.com]
Edited by seelan - May 30, 2018 09:26:23
User Avatar
Member
193 posts
Joined: March 2006
Offline
Hi,
yes it snaps while building the curve, but I want it import a flat curve from Houdini and than ray it to the unity terrain. There are some videos from older versions…

Thanks
Detlef
Edited by winkel - May 30, 2018 10:11:03
User Avatar
Member
193 posts
Joined: March 2006
Offline
Hi again,

another thing: I've made an HDA to build walls and inside I polyextrude and other things. But adding the HDA to unity triangulates my geo, so nothing works like I want. Do you have any idea?

Thanks
Detlef

Attachments:
wallaproc.hda (40.7 KB)

User Avatar
Staff
165 posts
Joined: May 2017
Offline
The plug-in will always triangulate geometry. What are the issues that you are seeing with your hda?
User Avatar
Member
193 posts
Joined: March 2006
Offline
Hi,
OK, my asset works (just some selfmade problems). But I can't find a solution for what I want to do:

1) Flat curve in Houdini


2) Asset in Houdini workes fine


3) Can't get the Houdini curves into Unity (nothing visible)

4) A Unity/Houdni curve object in Unity workes fine without auto update. Each time I edit the curve I have to recook the Asset


I want to import the original Houdini Curve (as HDA) into Unity
than ray this onto my Unity terrain and bring this into my Wall-Asset

Don't know if it is better to import a 400kb fbx file into unity, than building it with an Asset inside Unity?
Thanks for your support!
Detlef
Edited by winkel - May 31, 2018 06:54:18

Attachments:
wall02.jpg (31.3 KB)
wall01.jpg (51.4 KB)
wall03.jpg (97.7 KB)

User Avatar
Staff
165 posts
Joined: May 2017
Offline
I attached an HDA that provides an example of using an editable curve node inside the network, as well as providing an override external curve asset. A switch node is used to select one or the other.

For updating the curve to project down to the terrain, you can create a heightfield inside a subnet, and use that to project the curve onto it in Houdini. This should automatically update the curve when the terrain changes, and have your asset generate the terrain as well as the wall.

Attachments:
simple_curve_wall.hda (31.9 KB)

User Avatar
Staff
165 posts
Joined: May 2017
Offline
Additionally, I added a Project Curves button to the Curve UI which allows to project current curve points onto colliders or layer. This should help simplify what you're trying to do without needing a complicated setup. Look for it in tomorrow's build (16.5.490).

Attachments:
Unity_CurveUI.png (80.9 KB)

  • Quick Links