mtuttle
http://www.fevrierdorian.com/blog/post/2011/03/14/Remplir-un-mesh-de-spheres-dans-Maya-La-methode-d-un-senior
The above tutorial in French is I think one which shows a sphere-packing method similar to the one used in Pinocchio's auto-skeleton generator algorithm. The script is extremely slow though, and I can't figure out how to extract an actual skeleton from it, seeing as I don't have much experience dealing with nParticle data. Could soup be used to achieve the same result that the tutorial shows, and also be able to translate the nParticle data to vectors that could be used as joint positions (based on the largest radii, I guess)?
Reply 0 0
pshipkov
Take a look at the scatter node. Closely packet spheres is one of the things it can do. But realtime.
Check the "minPointToPointDistance" attribute. The only difference is that it uses uniform sphere radius controlled by that attribute. Also you probably want to set the "surfaceOffset" to the same value as the attribute above, otherwise the "spheres" will penetrate the geometry.

I can probably implement varying radius, it is one more lookup, but at this point i am not sure how useful it really is. Or maybe i am missing something. :)

Reply 0 0
pshipkov
Actually you can use the scatter node to instantly generate the base point cloud and then run the same script on it.

Everything you have to do is change that line:
points=getAttr(part+".position")

to:
points=getAttr("scatter1.outPositionPP")



Reply 0 0
mtuttle
Sorry for not getting back to this...Can scatter get the radius as well?
The other method I could try which seems more accurate is to apply laplacian smoothing on a mesh until the points "coalesce" so to speak, and at those moments create a joint, but I haven't figured out how to arrange all those smoothing+collision check iterations
Reply 0 0
pshipkov
Not sure what do you mean by "Can scatter get radius as well ?".
There is a an attribute that controls the distance between the "spheres" defined by the scattered points. If you increase its value it will start trimming points whose shperes overlap, etc.

With your second sentence you sound like you want to ensure points don't penetrate the mesh surface. If that's the case you can use the "minDistanceFromSurface" attribute.

Reply 0 0
mtuttle
My second sentence was referring to this: http://visgraph.cse.ust.hk/projects/skeleton/
I have found some source code which I think can preform the contraction (laplacian smoothing), but I haven't figured out yet how to check for when a region has been smoothed to its fullest extent and then make a joint chain from that...
Reply 0 0
pshipkov
The smooth deformer in SOuP does laplacian smooth too.
Probably the simplest way to check if region is smoothed at max is to compare the pre/post positions of the points during iterations. If the overall value exceeds some threshold then you still didn't reach the max smooth.

Reply 0 0
mtuttle
Hey, I've gotten back to trying this and I feel the original method I posted might be easier, except for that I still can't find a way to retrieve the "ideal" points to place a joint out of the points resulting from filling the mesh with nParticles. The script I originally found still provides too many points to sort through as it tries to fill every corner of the mesh with spheres, rather than just the places joints should be...
Reply 0 0
pshipkov
To be honest i think that for good quality characters joints should be placed manually by person who has good knowledge in anatomy. I doubt it is possible to achieve similar results using hollow poly cage and procedural algorithms. Just saying :)
Reply 0 0
mtuttle
what about for weighting, then?
Reply 0 0
pshipkov
I think i have similar opinion on that. Heatmap for startup and then it is all up to manual labor.
Reply 0 0
Elizeusz
Painting weights in maya is easy :) there are  scripts which can help too. 
Reply 0 0
Reply