Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mesh deform - baby guide
#1
Hi all,

Hoping someone could possibly give some baby steps on how to achieve something.

I've done it once, but I think it was purely experimenting and I can't remember how to do it!

In short I have a mesh which has been subdivided, say, 20 times, think a sheet of paper.

What I'm trying to do is create a spline with curves, and as I translate the mesh along the spine, the mesh bends accordingly.

I only need one instance of the mesh, I don't need in stretching, nor do I need it repeating several times (think the barbed wire example).

I've looking at the examples, and I've seen the "DeformMesh" script, but each time I add that to my mesh, I get an error saying "Object reference not set to an instance of an object FluffyUnderware.Curvy.Generator.CGModuleOutputSlot.LoadLinkedSlots", and I'm wondering if there's an order to add things.

However, I have had an instance where I got exactly what I wanted, tried to recreate it, and failed.

I can get my mesh on a spline and change the position and have it move along the spline fine, but deforming it along the spline I just can't seem to replicate.

Just some very basic baby steps would be a huge help.
Reply
#2
Hi,
This should answer your question:
https://www.youtube.com/watch?v=eP6QEn9SFoM
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Hey that helps a lot, thank you!!

Didn't see that video on the PlayList, so apologies.
Reply
#4
No worries, happens to the best of us Smile
I hope it will help.

If and when you feel like it, please leave a review for the asset, that helps a lot.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
100% going to leave a review in next few days, I'm absolutely loving this asset!

That video you pointed me towards answered everything I wanted, and with this help of this post from a few years ago ( This awesome post ) I've managed to recreate it dynamically in code.

The only problem I've got is when it comes to adding the transform to the InputTransformSpots.

Like the video at 2:20, I've added an emptyobject (in code), but I can't seem to add this to the InputTransformSpots module and get an error of
Argument type 'UnityEngine.GameObject' is not assignable to parameter type 'FluffyUnderware.Curvy.Generator.Modules.InputTransformSpots.TransformSpot'

The struct doesn't seem to support a setter, only a getter.

Any pointers?
Reply
#6
Hi,

The TransformSpots list is of the following type: List<TransformSpot>. So you can't add a GamObject to it, you have to add a TransformSpot. Thus the error you got.

Now, you indeed can't create a TransformSpot via API. This is something I missed, thanks for pointing that to me.
I will fix this in the next update, but until then, here is how you can fix it yourself:
  • Go to the definition of the TransformSpot struct (in \Assets\Plugins\ToolBuddy\Assets\Curvy\Scripts\CG Modules\InputTransformSpots.cs)
  • Add to it the following constructor definition:
    Code:
    public TransformSpot(
        int index,
        Transform transform)
    {
        this.index = index;
        this.transform = transform;
    }
  • Use the newly available constructor to add instances of TransformSpot to the TransformSpots list.

Let me know if this didn't work.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#7
Yeah that works a treat!

Thanks Aka, quick and accurate response, can't ask for anymore!!
Reply
#8
You are welcome Smile
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 22 04-17-2024, 10:57 AM
Last Post: _Aka_
  Adjust radius of generated mesh via script? Shackman 1 4 03-26-2024, 01:12 PM
Last Post: _Aka_
  Not seeing mesh extended after following YT PaulM 1 3 02-02-2024, 12:01 PM
Last Post: _Aka_
  Trigger Zones along Spline Mesh dlees9191 1 5 01-05-2024, 10:18 AM
Last Post: _Aka_

Forum Jump: