New To Animation: Bend Modifier Help with Flower


#1

So everything was going as expected. All was well in the land of flowers and Maya
well almost. I’ve run into a snag when it comes to bending the flower. My non-linear bend modifier controlling the stem don’t seem to be moving the rest of the modifiers associated with the petals and filaments. Only the geometry of the petals and filaments is moved. I have tried all sorts of different parenting and grouping methods. Nothing seems to make the modifiers move. I think that when moving objects with modifiers Maya doesn’t register the geometry moving in the same was as if you translated it. Since the translate is not updated the parenting structures seem to be of no use. The modifiers just say in place. Quite frustrating if you ask me.

I started looking into parenting the modifiers to a vertex or face. I quickly came across this plugin: DJ Rivet. DJ Rivet creates a hair follicle and parents the follicle to a geometry face. It then parents your object to the hair follicle. This plugin looks to be exactly what I need, but I am having 2 problems with it. One; it doesn’t want to install properly for me. When I got to load the plugin it doesn’t show up in Maya 2011. I have placed it in the bin/plugins directory where all the other plugins are, but it doesn’t show up in the plugin list in Maya. Two; it has been said by a few people that this tool doesn’t parent well to geometry that is being deformed

I might have to write a custom script for this. I’ve never done that before and it’s actually a little daunting. I figure I can track the position of a face on the stem by averaging the world position of the 4 verts surrounding that face. I can then grab that faces normal orientation and use it to set the rotation of the grouped deformers. As long as the face referenced is one from the top cap of the stem cylinder I’m thinking this should work. Consequently if anyone knows a far easier way, or a script that’s already been developed please let me know.

Any suggestions would be of great help, even if they are to say that I’m going in the wrong direction and method X would be better.

Here are some shots to help illustrate my problem.


#2

DJRivet is a MEL script, not a plugin, so you need to put it in your scripts folder and then source and run it from the command box or script editor. The scripts folder will typically be (on Windows anyway) in >Documents>Maya >Scripts.

I think you’re on the right track though, and DJRivet should do the job for you. The thing with deformers is that they only effect the meshes on a vertex level, if you select the transform node for the mesh shape you’ll see that there’s no effect on it from the deformer.

Cheers,
Brian


#3

I’m starting to see where I went wrong. I figured from the get go that there was something strange about modifiers and transforming objects. Thanks for confirming my suspicions. A friend of mine suggested a hair and spline system with clusters. To be honest I’ve never looked at either of those objects, but he’s sending me the file so I can dissect it tonight when I get home.

I was also thinking that I could setup a curve with locators on it. perhaps I could parent the flower head to a locator atop the curve and then use a bend modifier to shape the curve. I’m not sure if the locator that gets moved with the curve will take the flower head with it.

At any rate at least I have a few things to try out over the weekend.

Cheers :smiley:


#4

Are you using at least Maya 2011?
There is a point on poly constraint that works like a charm.
Just select a point on the head of your flower and then select a locator that you want to parent all your deformers to…Constrain > Point on Poly. It will snap the locator to the vertex you had selected. Then just parent your deformers to the constrained locator.

BUT, I have another suggestion for you that I encourage you to try.
Of course I am assuming a little bit here about your setup…but I am pretty confident no asses will be made…this time.
IF you are doing all this with deformers you can just change the deformation order and it won’t matter if the deformer handles follow the head of the flower. It looks like it won’t work…but that is the tricky thing about deformation order. As long as the full stem bend is the last deformer input (at the top in the channel box) on your mesh, all of the other deformers should behave the way you want them to.
Once you think about it as a progression it makes perfect sense…all the other deformers happen first then the stem bend moves the flower head away from the deformer handles. But the earlier deformations will have already happened!
Just in case you haven’t changed deformation orders before. RMB over a selected mesh and go to Inputs > All Inputs… The window that this brings up allows you to change the deformation order by using the MMB to drag and drop deformers. It usually takes a few tries to move things around. But it is well worth learning how to do.
Good luck!


#5

Yay. Everything is going great. Between Horganovski, Animatedfox, and a RL friend of mine. I have figured out a fantastic way to get the job done.

First off I corrected the deformation order. Modifiers are now working properly.
Next I used a hair strand as a wire deformer to control my stem poly mesh.
I then found a great tutorial on how to create a growing vine rig on vimeo by Jordan Blit. It sets up a relationship between the number of split poly rings and the Y height of the stem mesh. As a bonus everything is also effected by dynamics because of the hair driving the deformation.

I’m so happy :slight_smile:

My next step is to model the blend shapes for the bud, petals and filaments. Then I will test duplicating the flower group. If that goes well I’ll start working on the particle instancing system.

Again thanks to everyone for their help. I will post some progress shots/video here soon.


#6

As for duplicating an elaborate setup like this that you still need to control each flower individually…I would use file referencing and have multiple references of the same file.
Definitely worth reading up on.
Or just import the file as many times as you need.
Just a thought


#7

So duplicating the whole flower group and instancing it wouldn’t be a good idea? Is this because it would take up too much RAM? I’m hoping to get a nice couple of branches blooming. No more than 75 flowers in total.

I will look into referencing the files. My idea for controlling all the flowers individual elements was to write expressions in the different modifiers that all pointed to one control. Each element would use this plus a random number added together to control each element. This way you could generally control all flowers, but they would all look a little different.

I’m worried that if they are copies or duplicates of each other that the random number in each expression will be identical for each flower thus making them all have the exact same randomization in each attribute.


#8

When you reference in files you have the option to add namespaces, so you could setup the expression to look for that too, so that it will iterate though the list of rigs and apply value ‘1’ to ‘1:flower’, value 2 to ‘2:flower’ etc where the 1 and 2 are the namespaces you add as you import each copy of the rig.

I’m sure with more scripting work you could automate the whole process, so you could have a script that imports the same rig x number of times and assigns the x namespace as it does each one. Might not be needed if you were just doing a handful though.

Definitely look into file referencing though, it can seem a bit confusing at the start but it makes life so much easier in the long run. If you need to adjust/fix something on the rig you just open the source file, fix and save again. Then go back to the file where you’ve referenced in the rigs and the changes are all in place.

EDIT - hmmm this is an interesting thing to try scripting wise, give me a few moments and I’ll see if I can whip something up that can import multiple rigs and add the namespaces.

Cheers,
Brian


#9

Ok this should at least get you started, (man I love MEL for automating stuff that would be really tedious to do by hand!)

The following script will look in your project>scenes folder for a file called ‘cubeTest’ and reference it in 5 times, giving each one a namespace of rig1, rig 2 etc (you can’t just have the 1, 2 etc without some letters in front as Maya doesn’t like this naming).


   global proc bh_referenceMultiRigs(string $filename, int $rigcount) {
   
    for ($rc = 1; $rc < ($rigcount+1); $rc++)
   
    {
   
    string $proj = `workspace -q -fn`;// get the project folder file path
   
    string $filePath= $proj+"/scenes/"+$filename+".mb";// build the full path to the rig file
   
    string $defNS = ("rig"+$rc);//set the namespace for each copy referenced in
   
    file -r -type "mayaBinary" -gl -loadReferenceDepth "all" -namespace $defNS -options "v=0" $filePath;//reference the rigs into the scene 
   
    }
   
    }
   
     bh_referenceMultiRigs("cubeTest",5);
   

The last line in the script is the part that calls the function and gives it the file name and amount of rigs to reference in, so just change “cubeTest” and ‘5’ to suit the file name and number of rigs you want to reference in. I tried it with 75 here and it works fine : )

A couple of caveats - the script expects to find the rig in your project>scenes folder and also expects it to be a .mb file, so if either of these are not true it will fail. I’ve included comments in the script though so it should be pretty easy to modify.

So now when writing your expression just make sure it looks for ‘rig1:myrig’, ‘rig2:myrig’ etc and it should work fine.

Hope that helps,
Cheers,
Brian


#10

That’s really cool of you to help me with this. I’ve been looking for examples for referencing scripts all night :slight_smile: I’ll go through it when I get off work and see what I can glean from it.

All this animation and rigging is fairly new to me. I did a graphic design program at college here for two years and my major was 3D. I’m heading back to school this fall for a final year. This year though will be all 3D so I’m pretty excited. I love school and learning new things.’

I should also mention that I know a fair amount of computer programming. I took the first year of computer science through correspondence at the local university here. It makes MEL a little easier because I understand the general syntax of it. The hardest part is finding out all the commands and functions you need to know to get the job done.

Thanks again.


#11

You’re welcome, glad that helps. I started using Maya for the first time towards the end of 2010 having worked with a different app for a few years doing freelance character rigging and animation.
Transferring over the concepts I already knew about rigging wasn’t too difficult but I realized pretty quickly I’d have a tough job if I didn’t get stuck in and learn some MEL to help with workflow.

I’m far from expert now which is why I enjoy these little brain teasers and an opportunity to practice with it. The first thing I had to do in Maya was rig characters and set up a pipeline for several animators to produce animation for a game engine, so I had to get a handle on referencing to help with that. So now I have some of my own scripts I wrote during that time that I can pull apart for references.

Regarding learning MEL, I bought the ‘MEL 101’ DVD from Gnomon and found it gave me a great start. The built-in MEL command reference in Maya is surprisingly well written and laid out too, once you have the syntax you can pretty much look up most things and find the relevant flags and parameters.

Cheers,
Brian


#12

I’ve worked some more on the rig and I’ve solved all my problems now. The next step is to animate the bud opening so the flowers petals can scale out. I have made a new post with the details at my blog.


#13

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.