playMaker

Author Topic: How do I make a 'proxy' component that listens to a script?  (Read 612 times)

wetcircuit

  • Full Member
  • ***
  • Posts: 158
    • wetcircuit.com
How do I make a 'proxy' component that listens to a script?
« on: November 19, 2021, 11:56:28 AM »
You can probably guess that I'm not a coder. I understand some things by osmosis but a lot of Unity C# is unintelligible… I'm trying to do better, and learn.

What I think I need  :-[ is a PM 'proxy'  (some kind of listener component) that passes a script's internal variables to an FSM.

the actual situation is a live mocap suit that sends a data stream to a Unity component, which takes over a 3D figure's Animator, feeding it the stream of bone rotation data. From what I can see in the script, it is just cycling through the HumanBodyBones, getting rotation data from the suit (quaternions) and setting the data on the figure's bones…. The suit is 'live', it constantly updates the stream.

for reasons…  ::)  ;) I would like to intercept that data to create PM variables (an array?), where I can manipulate it with PM before setting final values on the figure. With PM's Animator actions, I can intercept with IK, smooth data jitter, etc. Essentially using Playmaker instead of Unity's Animation Rigging.

What I can currently do (without coding knowledge) is use the Animator script as intended on a skeleton with no render geom, read the bone rotations with PM, [do PM magic], before setting the values on another 3D figure (with render meshes).

 ??? since I don't know what I'm doing in C#, I'm not even sure if I am asking the right question… or how to determine if this is something I even need… should I…

  • Learn the code – writing variables to PM is easy.
  • Hire someone – it would take longer to explain and is too specific to bother with tutorials
  • just read the bones off the skeleton with PM – (it's a personal project running in Editor, not a published game)
  • other…?

My goal isn't actually to learn to code, just to do the thing I want to do…
I know it's a dumb question. C# makes me feel dumb.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How do I make a 'proxy' component that listens to a script?
« Reply #1 on: November 19, 2021, 12:04:31 PM »
Hi.
on the Playmaker API there are some sample on how you can get/set fsm Data from/to scripts.

maybe this can help

wetcircuit

  • Full Member
  • ***
  • Posts: 158
    • wetcircuit.com
Re: How do I make a 'proxy' component that listens to a script?
« Reply #2 on: November 19, 2021, 12:24:38 PM »
Thank you…. Without understanding C# a list of API commands is a bit opaque. Like getting a full keychain of car keys but not knowing how to drive, you can't get very far, LOL.

I think really it answers my question, though. I'll do it the get/set way.