Wednesday, April 25, 2012

Hair Script - Progress #5 / What a glitch

I started testing my script on modeled hair instead of polygon planes and I ran into three glitches.

Glitch 1 - Happens if the modeler modeled hair for one half of the body then mirrored it to the other half.   When I create and duplicate my curves, it will duplicate the U spans on one side, but the V spans on the other.  I "think" I can fix this glitch by rebuilding all of my NURB surfaces once they've been created.  I didn't want to do this because it's messy, but I'll just do some "create grouping" and hopefully no one will notice...

Glitch 2 - Happens if the modeler has combined all of the small hair meshes into one super mesh.  The script still works, I think it'll make rigging the original hair a lot harder.

Glitch 3 - Happens when the modeler has groups in groups.  My script works by selecting one hair group instead of marquee selecting all of the hair.  So if you select one top group, my script will end up duplicating the groups IN that group then when a for loop get to that transform node, the entire script will stop working.  Ugh, what a mess.

~Melissa

Monday, April 23, 2012

Hair Script - Progress #4 / Maya Fluid Explosions!

Remember that nuke explosion that I talk about once every 6 months?  I'm STILL working on it lol.  I got a little side tracked with ground explosions.  I'm learning about shaping my fluids with multiple emitters and volume axis fields.  I'm also learning about lighting my fluids and rendering them out in separate passes.  Fun stuff.  I'm still inexperienced when it comes to texturing fluids, so if anyone out there has any good tips/resources they'd like to share, I'm all ears!

Anyway, my hair script!

Progress!  The polygons to nurbs feature works better than I could have hoped for.  I had to completely destroy and rearrange 50% of what I had to get it to work, but it works!  Of course, if you could nest procedures in MEL, I wouldn't have had any problems. (Another reason for me to start working with Python).  My curve duplication is well on it's way to working too.  I'm just trying to figure out the best way to name my curves.  I know I don't HAVE to, but I think it looks bad to have duplicatedCurve40388 in your scene, even if the user will never see it.

The next thing I have to worry about is grouping everything so the user isn't left with a messy scene, but that's not going to be too bad.

I don't know what I want to tackle once I get the curve creation thing to work.  I could create the paint effects hair, or rig the hair.  Rigging will be harder, and it's about 60% of the entire script so I might tackle that first and get it out of the way.

Progress - ????% I don't even know anymore.

~Melissa

Saturday, April 14, 2012

nHair demonstration! What's new in Maya 2013?

(0:01 - 5:35)
New Features in Maya 2013 - Check out the original site!!

I'm geeking out over the nHair demonstration in this video!  Features I love already:
  • Adjusting the thickness of hair strands.
  • I'm hoping that attributes are paintable here like they are with other nObjects.
  • Collision.  The hair looks like it reacts to itself better (and faster) and we'll be able to set up complex collision objects instead of being confined to the HORRIBLE collision spheres and cubes that just don't work well at all.
  • It's ability to interact with other nObjects like nCloth and nParticles.
  • CONSTRAINTS THAT DON'T SUCK!!!

I hope that in the future we'll get to see tools (brush, combs [scissors?  Please???]) that will aid in the styling process.  But I'm really happy with the people at Autodesk right now.  Really, really happy.  Seriously.  I'm the happiest girl in the world right now.  I can't wait to get my hands on this.

~Melissa

C++

I have a dream.  A dream of being fluent in MEL, Python, Perl, C++ and LINUX/UNIX shell scripting.  I love programming.  I really, really REALLY, REALLY do.  I just wish I were better at it.  I can scrape along, ask the right questions when I'm stuck, but there's so much more for me to learn.

I want to know more.  I want to be better.  I've decided to take a Fundamentals of Unix/Linux class as well as a C++ class this summer, but I started studying early.  I've learned a lot already.  There are still things I struggle with, but I know I'll get the hang of it.  I hope.  MEL, Python now C++.  Let's hope my brain doesn't mix these all up.

~Melissa

Thursday, April 12, 2012

Hair Script - Progress #3 / MEL info

I've been bad about labeling my posts.

Anyway.

I wanted to learn how to put tabs on the side of a window and make it a part of Maya.  I thought there was some hidden way to do this with a tabLayout, come to find out this wasn't a tabLayout, but were several windows with dock controls.  I'd never heard of dock controls until today.

dockControl
Create a dockable control, also known as tool palette or utility window. Dock controls are secondary windows placed in the dock area around the central control in a main window. Dock windows can be moved inside their current area, moved into new areas and floated (e.g. undocked). Dock control consists of a title bar and the content area. The titlebar displays the dock control window title, a float button and a close button. Depending on the state of the dock control, the float and close buttons may be either disabled or not shown at all.


(Pardon my sloppy mouse writing.  My tablet is downstairs and I'm too lazy to get it so...)

I'd wanted to do this with my hair script since day 1 but I just couldn't figure out how.

I found out dockControl was something introduced in Maya 2011 (figures.  I've been using Maya 2010 until a few months ago).  So, I can do this, but if someone wants to use this script in Maya 2010 or an earlier version, it will error out.  I've decided to use dockControl, and build a second UI for users who have Maya 2010 and earlier.

But how will my script know?!

The handy command:

getApplicationVersionAsFloat
Return the application version number as a float value. If you use the "about -version" command you get a string value containing the application version. Strings of course may not be used in comparisons like: if ($version > 3.5) { ... }; This procedure will return a float value containing the major and minor version number. The major version will be separated from the minor version by a decimal. For example, 4.0.3 will return a float value of 4.03.


So I can do:

global proc $ss_hairDo(){
     if (getApplicationVersionAsFloat() >= 2011){
          do my dockable window;
     }else{
          do the safe window;
     }
}


Sad thing is, this command is only available in MEL.  I guess my tool will end up being a blend of Python and MEL, which isn't so bad.  There are a lot of things I'm going to gut out and replace with Python since it does things more efficiently.

Anyway, it shouldn't be too bad creating a second window, just ignore all of the dockControl stuff, and it should be fine.

*famous last words*

~Melissa


Thursday, April 5, 2012

Hair Script - Progress update #2

Rather I should say lack of progress.  I lost my most recent file.  I have no idea what happened to it, but it's gone.  I don't feel too horribly about it.  Even though I spent a good 12 hours of it, 10 of it was spent researching and understanding what I was doing.  I remember what I did, so now it's a matter of retyping the ~50 lines of code that I'm missing, which shouldn't take more than an hour or two. <== *famous last words*

Estimated Progress = 10% complete

Issues I'm facing:
1) Redesigning the GUI.  The current one is fugly and I only slapped everything on so I could test various sections of my code.

2) Incrementing, starting from the last object number in a group.  If there are 10 objects in a group, and someone runs this script again, I want them to have the option of just deleting the group and renumbering everything, or starting from 11 and going on from there.  I'm not sure how to increment, starting from the last number so I'm asking around.

~Melissa