Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a Module / reading spline data
#1
Hi Jake

I notice that the module documentation is not available at the moment so I would appreciate some guidance Smile

With 1.6 I wrote a script that could take the control points of a curve and feed them into Megascatter where it could use the data to scatter various objects along the spline.  Ideally I would have a module that could do this that I could feed into the graph but I don't know how to do this.

Another option might be to say add an event callback in the generator after say, the volume mesh has been created, that can then (maybe) pass the spline in to my own method that can read the spline data and feed it into megascatter - though again I am not sure how to read the spline data this way.

Also if you have a simple example of reading the control points of a spline or could point me to some sample code that could be fantastic Smile

cheers

Nalin
Reply
#2
Oh, yes, a tutorial to create a module is missing. Start by taking one of the simpler processing modules (e.g. TRSxyz or even one of the debug modules) and find your way around. Intellisense is of great help here, just examine the available virtual methods and it's descriptions.

One thing to note is that CG doesn't rely on splines (except the InputSplineXXX modules) but on paths. So you won't be able to get Control Points from a CG path, instead you would use the rasterized vertices (.Position). If you use splines directly you would use the ControlPoints list to access all CP's.

Oh, and all modules already have events, just open the Events tab of a module and hook your callback into the OnRefresh event.
Reply
#3
Thanks Jake,

I tried the module approach, but encountered quite a few errors and could not get it to read the spline - using TRSPath as a starting point.

If you have a simple sample that can iterate through the Spline/path and just print them out that would be cool?

cheers

Nalin
Reply
#4
TRSPath works on "virtual" (unrasterized, green slots and lines in the graph) paths, i.e. the actual points are created lately when another module requests rasterization. I agree that this is confusing at first, so take a look in the RasterizePath module, perhaps with a DebugPath module attached to it. The first module triggers the actual rasterization while the debug module visualizes it. After rasterization, the Path data contains plain points (and orientation etc.) that you can use.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Wheel Collider to propel along Spline Phunyun 1 21 08-23-2019, 10:09 PM
Last Post: _Aka_
  Curvy Spline mover is jerky BlankMauser 5 87 08-16-2019, 09:31 PM
Last Post: _Aka_
  Camera wobbles on too long spline (100km+) Vectorvision 10 315 08-01-2019, 12:35 PM
Last Post: _Aka_
  Closest point From a Ray (a line), to the spline UsernameHed 5 190 07-31-2019, 03:57 PM
Last Post: _Aka_

Forum Jump: