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
  Path not as smooth as spline jawadkhan.9026 3 45 06-12-2019, 11:19 AM
Last Post: _Aka_
  Orient Spline to Object DanMarionette 1 21 06-11-2019, 05:56 PM
Last Post: _Aka_
  make a spline branch smoothly off another spline dazz777 3 75 06-06-2019, 08:16 PM
Last Post: _Aka_
Photo How can i assign spline at runtime lololToday 1 49 06-05-2019, 01:02 PM
Last Post: _Aka_

Forum Jump: