Hair Plug-in Concept

Just today, I thought to myself, why can’t I make a hair plug-in for Blender that’s just as good as the ones in the commercial packages? So I came up with a plan for the Ultima Hair Generator.

In my concept, you can select the polygons you want covered in hair. Then, you select your Density, Stiffness/Limpness, Reactiveness to Gravity/Wind, Clumpiness, and its color. Also, in Color, there would be a Variation slider, using black and white tones in proportion to the number of strands to variate the strands.

After generating your straight strands of hair (or fur), you would isolate different clumps of it to begin styling, perhaps with different handles that culd be used to drag the hair where you needed it.

Finally, your hair would “Solidified” if you wanted a hair-sprayed cut that you didn’t want to have moving.

My concept is not quite like the Fiber Generator; rather, I’m thinking more of Sasquatch or something like Maya Hair. Does this idea sound plausible to you? If so, I would like to know where to get a start in my Wizard.

~Suu999

the mh team working on a system for allow to make easily hair like these ,
https://blenderartists.org/forum/viewtopic.php?t=39091&highlight=
the system is almost ready and will have released soon

Also Fiber 3, that will be a commercial quality hair system should be out soon also.

LetterRip

Ho and dont forget beast… and the particle engine also.
They can do good stuff too. beside the limitation.

i would like to see another hair plugin, i’m quite happy with the actual solution but you have to admit tha each one has it’s own limitation.
so maybe this new system could be without such limitation, or actually better usable in some situation that an other existing script.

Personally, I don’t see anything wrong in having many options to do one thing. If Suu999 wants to do this, we should encourage, rather than discourage. Go for it, man!:slight_smile:

Yep, I do agree. The more the better.I even use a software per task, it’s allways very welcome. And specially hair.

It makes the horizon really exciting with all these options.
Doing a character with hair is a totally new world. I did with shag hair, and it’s really bringing to live and realism your character.

And as said, hair is really complex to achieve, and there are situations where one aproach is better than another, and viceversa.

I like that one Gillan. Wont be available independently from makehuman?

I mean, I love to model from scratch all my humans. I think you’r all doing a great work on that project, but I have allways the need of start from scratch…Not a need, I just much prefer so.

Thanks for all the encouragement…but one problem: where do I start coding hair? I’m just getting into Python, and would like to know a little about how you code things as hair. Would love to hear some advice! (i’m taking VB now, so I know something about programming)

yes! soon will be available a stand alone version of the hair system, like the mhsss, after the test, it will come integrated in mh, but then it can work alone on your character too.

I didn’t want to discourage anyone, only inform Suu999 of the situation

Suu999,

Thanks for all the encouragement…but one problem: where do I start coding hair? I’m just getting into Python, and would like to know a little about how you code things as hair. Would love to hear some advice!

The short answer is learn python and study the curve releated tools of Blender. then you’ll want to learn about getting information from vertex paint (which you would likely use for defining the distribution of hair, and other hair properties), materials, etc.

(i’m taking VB now, so I know something about programming)

A statement like that implies that your experience in programming is probably not strong enough to tackle something like a hair tool. I’d recommend experimenting with creating basic mesh manipulation tools first. Also look at other peoples scripts - Fiber 3 will be out soon, that will give you most of the knowledge you need (although instead of your own from scratch, your time would probably be better spent adding functionality to either the makehuman hair tool or the Fiber 3 hair tool when they come out.)

LetterRip

/me claps his little hands :slight_smile:

It’s so nice to both hear and see that you are all working on excellent hair-solutions
for Blender. YAY that makes me so happy I’m at loss for words.

I’m not a coder, but I do have a suggestion for those of you who know Python. I think what would be really useful is to beable to use something like the knife tool on hair.

For example, I’ve worked with models in which I really wanted different lengths of hair on the same face. With the current options, I haven’t found any way to do that, but a knife tool would make it very easy.

So you are a Vb coder? If so, I would think that it wouldn’t be that much different coding in python than in Vb. There are some differences in python that would make coding like a Vb programmer difficult.

To my experience, Python’s object scope would be one hard point that I would have diffulty in. Usually, python’s program scope variables require a “global varname” when used within its functions. Python functions are also different. When defining functions in python, you don’t need something like a “end sub” or “end function” at the end of the function. Function declaration in Python goes like this…

def functionName([varlist]):”

The body of the function follows the line after the declaration and must be tabbed correctly.To end the function, simply leave a blank line.

Here’s an example…


#This is a comment python alternative to '
#This function defines the txtName_Change event
 
def txtName_Change():
     print "The new value for txtName is " + txtName.val
 
# ^^^ blank line ends the function.

About the gui… creating an event driven graphical user interface was easier than differentiating between Vb code and Python code. To achieve the structure neccesary for an event driven gui like Vb, you need the following…

  • Program init function - this is much like the form_load of vb6.
  • Program uninit function - this is much like the form_unload of vb6
  • Blender event handler - Has arguments (evt). Responds to user actions happening in gui.
  • keyboard and mouse event handler - Has argumants (evt,val). Responds to keyboard and mouse events.
  • gui function - used to render your guiUse your init function to start your program. Within the init function, use the Draw.Register(Gui,event,bevent) function. That function starts up your gui.

In your gui function, all gui elements such as text boxes and buttons are variables. define them as global first, then give them a value. Each gui variable would have an event number which would be passed to the blender event handler.

In your blender event handler, check to see which event happened and call your functions accordingly. Since python has no switch statement equivilent, use the if…elif…else statement.

As for the Keyboard and mouse event handler, the schematic is the same as the blender event handler.

Here’s the gui setup as a reference…


 
def bevent(evt):
     if evt == 1:
        txtObjName_Change()
    elif evt==10:
        cmdExit_Click()
    elif evt==11:
       chkEnabled_Click()
    else:
       return
 
def event(evt,val):
     if evt == Draw.ESCKEY:
        #end application
        progUnInit()
 
def Gui():
     #These variables belong to the GUI of the program.
     global txtObjName
     global cmdExit
     global chkEnabled
     txtObjName = Draw.String("Object Name:",1,10,29,258,17,strObjName,20)
     cmdExit = Draw.PushButton("Exit",10,94,192,81,33)
     chkEnabled = Draw.Toggle("Enabled",11,10,200,89,17,blnEnabled)
     Draw.Redraw(1)
 
def progInit():
     Draw.Register(Gui,event,bevent)
 
def progUnInit():
     #terminate gui interface
     Draw.Exit()
 
def txtObjName_Change():
     global strObjName
     strObjName = txtObjName.val
 
def cmdExit_Click():
     progUnInit()
 
def chkEnabled_Click():
     global blnEnabled
     blnEnabled = chkEnabled.val
 
.....
.....
.....
 
#======#
#When all functions are defined, initialize the program...
#======#
 
progInit()
 

I hope this post wasn’t too long. I also hope this would make your Vb -> Python experience much more enjoyable. Good luck with your endevor.

Besides the last post in this thread being over a year old, you can also do what you want with weight-painting:
http://www.blender3d.org/cms/New_Particle_options_a.721.0.html

I was hoping this would be some fancy script to generate hair style guides :stuck_out_tongue:

kitsu.: The only thing about the new hair additions to the particle system is that they only work for static renders. If you want to use that “hair” in the Game Engine or to export it to some other format you are out of luck. That is the reason I liked Ripstring’s Fiber2.03 and was looking forward to Fiber3.0. That script output true mesh objects which you could then export to other programs.