playMaker

Author Topic: Vectrosity.AddProxy() - Example Please?  (Read 2676 times)

memetic arts

  • Full Member
  • ***
  • Posts: 141
Vectrosity.AddProxy() - Example Please?
« on: March 26, 2013, 09:57:06 PM »
Hello all -

Can someone please post a working example of how the Vectrosity.AddProxy method is supposed to be implemented?  My attempts have failed . . . I'm getting an error that reads: 'AddProxy' is not a member of 'Vectrosity'.

Basically, I'm generating a spline like this:

Code: [Select]
var splinePoints = new List.<Vector3>();
.
.
.
spline point generation code
.
.
.
var spline = new VectorLine("Spline", new Vector3[segments+1], null, 2.0, LineType.Continuous);
spline.MakeSpline (splinePoints.ToArray(), segments, loop);

I've tried adding both
Code: [Select]
Vectrosity.AddProxy("Spline");
and
Code: [Select]
Vectrosity.AddProxy(spline);to the end of the script, which apparently doesn't work.

Not sure if it's syntax or just in the wrong place altogether.

Thanks in advance for any/all help!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vectrosity.AddProxy() - Example Please?
« Reply #1 on: March 27, 2013, 07:33:25 AM »
Hi,

 This is actually something only used by the framework I created to port Vectrosity to PlayMaker, and this addProxy is something handled automatically under the hood.


 What are you trying to achieve? do you want to create new custom actions for vectrosity?

You can add a proxy using the following code:

Code: [Select]
_line = VectorLine.SetLine(color.Value,time,_points);

VectrosityProxy.AddProxy(_line);

basically, this proxy allows me to create convenient custom action, without this, I can't reference a vector as is.

and to use this proxy, you can study the following custom action script: VectrositySetColor, where I expect the user to reference this proxy, so that I can set it's color.

bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity.AddProxy() - Example Please?
« Reply #2 on: March 27, 2013, 08:34:37 AM »
Excellent, that's exactly what I needed in terms of syntax. I think what was catching me up is that I was using Vectrosity.AddProxy, which is what the documentation says, whereas you are actually using VectrosityProxy.AddProxy . . . so maybe the doc needs to be updated?

As far as what I'm doing . . . I'm trying to find a way to reference Vectrosity lines/splines that are created on-the-fly from script.  I can't reference them directly because the name is unknown until the time that they are created.  Based on what you've said, I'm not entirely positive that Vectrosity.Proxy is the solution, but I thought it was worth a try since nothing else seems to work . . .

Thanks again for the help!

==rr

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vectrosity.AddProxy() - Example Please?
« Reply #3 on: March 27, 2013, 08:48:36 AM »
Hi,

 if you create the vector lines yourself, then you ought to get a pointer to them. Else you will face the problem as I did, and this proxy is indeed to recover the vector component on a gameObject, by simply reference this proxy to get and set any vector properties.

bye,

 Jean