Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a Module / reading spline data
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


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.
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?


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.

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to get length starting from one spline to connected nth spline Dragon-3623 1 1 05-14-2024, 04:52 PM
Last Post: _Aka_
  Help creating a wedge Thinkurvy 2 6 04-24-2024, 12:25 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_

Forum Jump: