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
  Method of scattering objects along spline joebain 1 3 11-26-2024, 03:20 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_
  Nested Spline Volume Spot Instantiation merobbins5 3 7 07-26-2024, 09:58 AM
Last Post: _Aka_
  Left-right movement, and spline follow shihaya 3 10 07-12-2024, 12:50 PM
Last Post: _Aka_

Forum Jump: