Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shape extrusion scaling
#1
First question:
I would like to vary the width of an simple shape extrusion based upon metadate data in the Spline Path Input's CP. Like a road that changes width based upon data at CPs.

I thought I could read the spline cp and get their meta data in a before render event, then generate the curve that the Shape Extrusion Scale X Multiplier uses.

Or I could do a similar thing using the curve for the Variable Mixed Shapes curve like you do in the demo video for that Module via E27_MixingAnimator. I would not need real-time changes so could also create the curve in the Start method instead. I could have a min and max width shapes and let the curve choose the width. This would be more precise than Scale Multiplier I think.

I tried to test this second case by manually creating the curve in the graph. But it doesn't produce the results expected. It generates only one change from beginning to end of the following path. Maxing the resolution on the Path tab didn't to change it. See attached screen shot. Not sure what I'm doing wrong?
I've also attached a the scene file.
If I change the shapes from circles to rectangles with different widths (my end goal), the results make no sense to me. The extrusion doesn't wrap around the volume or show on all four sides. The sides are not parallel as if they are trying to match different order points on the rectangle. See the second screen shot.

I'd like to understand what is going on in my failed scene example even if it is not the best way to achieve my results.

What is the best way to do this? There doesn't seem to be any modules that use Metadata from Spline Path Input to control things? Or am I missing it?
To go out-of-band from the graph data flow and pass the input spline path to a Variable Mixed Shape node via a reference like you did in the E27_MixingAnimator is one possiblity. Another is to use the OnBeforeRefresh event to setup the curve. This event could be sent to a method added to the CurvySpline reference in the Spline Path Input. Are their merits to one way over the other?

Since going out-of-band from the graph's data flow seemed a bit wrong, I looked at making my own Module but got lost trying to understanding the only Metadata example you have in the CGUtilities:GetControlPointWithOptions. 
How I'd use that with a Path Input on my own Custom Module, I don't know! The Path Input doesn't seem to have the Metadata access.

Getting at the CurvySpline and using the API to access the Metadata in either of the processes I described above seems simpler. I know how to get the Metadata from the spline with the API.

Second question:
I would like to use CP metadata in the Spline Path Input to control many things (change material used, etc...) but I'm not sure how?
Do I need to have many different Spline Path Input, each with their one start and end CP range to render sub-lengths of the same reference spline path? Is this very efficient?


Attached Files Thumbnail(s)
       

.unity   ShapeExtrudeTest.unity (Size: 76.38 KB / Downloads: 2)
Reply


Messages In This Thread
Shape extrusion scaling - by tairoark - 06-04-2022, 04:11 AM
RE: Shape extrusion scaling - by _Aka_ - 06-05-2022, 05:09 PM
RE: Shape extrusion scaling - by _Aka_ - 06-06-2022, 05:59 AM
RE: Shape extrusion scaling - by _Aka_ - 06-06-2022, 06:06 AM
RE: Shape extrusion scaling - by tairoark - 06-06-2022, 07:10 PM
RE: Shape extrusion scaling - by _Aka_ - 06-07-2022, 05:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 19 04-17-2024, 10:57 AM
Last Post: _Aka_
  Fading in/out extrusion mesh of a spline? _RicO 3 5 07-25-2023, 09:40 PM
Last Post: _Aka_
  Animating a shape on along a spline will not playback in scene or game views sam_bond 3 9 05-03-2023, 11:41 AM
Last Post: _Aka_
  Inaccuracies with offseted Shape Extrusions MichaelMenzi 6 15 12-14-2022, 10:22 AM
Last Post: _Aka_

Forum Jump: