Monthly Archives: October 2010

Install Wizard with PyQt

My work is mostly about developing tools, which consists of a lot files of different kinds: dll, mll, mel, slim, exe, ini, py etc. Each of them should be copied into specific folders to be functional. But artists don’t have the mind taking care of all the technical details, so there always be a lot of confusion about copy what to where. I decide some automatic install script with user interface should be necessary to help artists out of the trouble copying those files by hand, and to prevent error.

This is a simple install wizard in Python and PyQt.

First page introduces what will be installed.

Second page shows where RAT/RMan is found on your system. Also asks which disk your Maya project resides.

Let the wizard do the tricks.

So it is finished.


Leave a comment

Filed under Uncategorized

Git Bare Repository

Assume programmer A already have a Working Directory at //serverA/share/proj, and programmer B want to help. A bare reposittory shold be created at //serverB/share by:

git clone --bare //serverA/share/proj

there will be just a folder –┬áproj.git. Now programmer B can get a fresh copy of his own by:

git clone //serverB/share/proj.git

When he finished a few commits, try:

git push //serverB/share/proj.git master

Then programmer A can have the changes by:

git pull //serverB/share/proj.git

The need for a bare repository is due to git rejects any pushing to a non-bare work tree by default. That rule can be overrided by changing config of receive.denyCurrentBranch, but pushing directly to a checked out work tree still feel like tricky.


Leave a comment

Filed under Uncategorized

Fake Hair Dynamics Again

Fake Hair Dynamic from angersaurus on Vimeo.

Changed the fake dynamic deformer a bit. The dragging effect is achieved by tracking position of vertex at previous frame. There is no fancy bend/shear resistance, damping, attraction or coliding, but it is fast and much easier to handle. Just a simple trick to cheat, to give some movement to the fur, when there is no time for nCloth simulation.

Leave a comment

Filed under Uncategorized

Pixel Hair Revised

This document is about the idea of pixel-based hair.

First, I will explain how the traditional hair works:

  1. Attach a guide curve to each vertex of the mesh.
  2. Each triangle has three guide curves.
  3. Split the triangle into a number of sample points.
  4. Grow a hair curve from each sample point. Direction of growth is the weighted average of the three guide curves, based on the sample’s barycentric coordinate inside the triangle.

Being a straightforward way to create lots of curves by a much smaller number of guide curves, I think most existing hair tools are using this method. Because guide curves are attached in each vertex, I’d call it vertex hair.

So why bother developing another method for this? Because vertex hair is not good enough. Where to put the control curves totally depends on the topology of base mesh. Sometimes the mesh is so dense there are too many control curves, which is hard to handle. Sometimes the mesh is so sparse there is not enough control curves, not enough details. Sometimes the base mesh must be changed, ruining existing grooming, which could be very unpleasant.

So I come up with the idea to set the control curves free from the mesh. This is how it works:

  1. Control curves are independent form the mesh. They can be placed anywhere on it.
  2. Split the triangle into points as usual.
  3. For each sample point, search all control curves for the three nearest ones that form a triangle around it.
  4. Grow the hair curve like before .

For example:

Random colored control curves

Samples colored by closest control

Hair visualization with a bit noise

The problem is we must find the 3 controls for every sample. This slow process can be cached by a texture. Split the mesh in ST space, so each sample will have a ST coordinate. Do the search, then save the result (3 id and 3 weight) to the relevant texel. Next time when create the hair, probably of a different density, we just look up the texture by sample coordinate to retrieve the result, avoiding the search. So I call this method pixel hair.

The search seems to be the tricky part. I found it is slow and hard to get correct result. So there is another idea: reverse the process. We already have the ST coordinate of those controls, so form a mesh using Delaunay triangulation. Dicing this mesh instead of the base mesh in 3D, we can achieve correct sample-to-control relationship and smooth interpolation of sample weight, without searching!

Control mesh formed by Delaunay method and samples diced in ST

What is the advantage? Those control curves do not depend on the base mesh, so they can be placed more efficiently. Just more controls around the area of interests to get more details, and ignore the area has no hair. Smaller number of controls means easier to handle and faster to do dynamics. Those control curves are just a low-density version of the hair, so it might give better control and more reasonable preview.

Leave a comment

Filed under Uncategorized

Fake Hair Dynamic
Original Video – More videos at TinyPic

Leave a comment

Filed under Uncategorized