playMaker

Author Topic: Get Vertex Position  (Read 6402 times)

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Get Vertex Position
« on: October 16, 2014, 11:12:17 AM »
I've been trying to export vertex constraints from Maya with no avail, now I'm trying to get vertex position then set position an empty game object so that it follows the constraint as I displace the mesh.  Thoughts?

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #1 on: October 16, 2014, 11:13:29 AM »
almost like a boat floating on water, but on a spherical ocean with many objects

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Get Vertex Position
« Reply #2 on: October 16, 2014, 03:41:15 PM »
I made a get vertex positions into array (with array maker) action - I think it is included in the package, give that ago.

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #3 on: October 16, 2014, 10:25:44 PM »
could you be a little more specific?  There isn't much documentation on arraymaker.

I need to dump the vertex indices into an array list first?  Then I set position based on the indices?

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Get Vertex Position
« Reply #4 on: October 16, 2014, 11:29:36 PM »
On sale today only is this package on the asset store https://www.assetstore.unity3d.com/en/#!/content/16318

Otherwise there is a 'get vertex position action' if you know the Vertex ID

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #5 on: October 17, 2014, 12:20:19 AM »
yea that's nice, but I'm pretty sure playmaker should be able to get me there.   

Say for instance, I know my vertex ID is 10,

Do I add a FSM GetVertexPosition index 10?  I store this in a global variable?

Can I just apply FSM to object, then SetPosition to the global variable?






postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #6 on: October 17, 2014, 01:03:00 AM »
It works partially, I'm able to parent the game object to a vertex, but it doesn't update at runtime so the object stays static, and doesn't ride the displacement.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Get Vertex Position
« Reply #7 on: October 17, 2014, 02:01:36 AM »
If you're are getting and setting with both set to everyframe it should follow :S

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #8 on: October 17, 2014, 02:08:02 AM »
this may be a bug?

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #9 on: October 17, 2014, 02:13:26 AM »
would the fact that the shader is displacing the mesh make a difference?  It behaves correctly when translating the parent.

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #10 on: October 17, 2014, 09:05:12 AM »
So I might need to drive displacement through a geometry shader not vertex shader, does this make sense

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #11 on: October 19, 2014, 06:03:28 PM »
Still wondering,

Can someone illustrate the process of storing an array of mesh vertices and parenting an object to one of the ID's? 

Thanks!!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Vertex Position
« Reply #12 on: October 20, 2014, 06:44:58 AM »
Hi,

 what custom actions are you using for this?

I have a set of actions for this within ArrayMaker, you can get positions, and then modify them, to then set positions, and it works.

ArrayListGetVertexPositions
ArrayListSetVertexPositions

https://hutonggames.fogbugz.com/default.asp?W715

 Bye,

 Jean

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #13 on: October 20, 2014, 08:20:19 AM »
I'm using arrayListGetVertexPositions, but failing to see how to set up the fsm and proxy game object, given that the example file isn't quite what i'm looking for. 

I'll keep trying

postjudice

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Get Vertex Position
« Reply #14 on: October 20, 2014, 10:15:57 AM »
I'm also not sure how arrayListSetVertexPositions is helpful in this instance, since I want to just set an object's position on a vertex every frame. 

And just to re-iterate, I'm displacing with a procedural texture, and I suspect that somehow this is not a allowing the mesh indices to update in world space.