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
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
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.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
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.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#7
Yeah that works a treat!

Thanks Aka, quick and accurate response, can't ask for anymore!!
Reply
#8
You are welcome Smile
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mesh Generation between two splines vatan 4 670 02-14-2025, 07:11 AM
Last Post: vatan
  Create Mesh Node, Make Static Options rickgplus 1 349 01-23-2025, 10:12 AM
Last Post: _Aka_
  Extrude mesh along spline. New and confused user GhostStalker 3 531 01-02-2025, 09:58 AM
Last Post: _Aka_
  Is it possible to make the face at the end of mesh? Chanon 3 431 11-14-2024, 04:38 PM
Last Post: _Aka_

Forum Jump: