Cage opened this issue on Feb 24, 2010 · 592 posts
Cage posted Thu, 25 March 2010 at 2:21 PM
Quote - This is fantastic . It seems to me it is already very useable, and you guys are pushing it toward perfection :-). They do say that last few percent of a project takes a lot of the effort, and you guys are sure putting a lot of effort into it. I will definitely study the tutorials.
I have tried looking at the program but it is difficult for me to get my head around it, especially since I am not up to speed on Python. Is there a flowchart in existence for the program?
I think a flowchart would help me to understand the program flow and therefore assist with understanding the code. I know you guys are super busy though, so please consider it a low priorty wish. I'm sure I will be able to get great results from this program whether I understand how it ticks or not ;-).Cheers and kudos to you guys.
Ian
Hi, Ian! Have you been able to work on your shorts for Antonia? I've been eager to see how they turn out! :D (I'd use the "big grin" smiley, but it looks potentially sarcastic to me. I miss the emoticons I use at another forum, sometimes. :lol:) I'm glad to know someone is still reading the thread. :lol:
I think a flowchart would probably be useful, for people who know how to read them. Sadly, I'm not one of them. :lol: Unfortunately, that means I can't create one. :(
The current process is basically this (Spanki needs to teach me how to use bullet points in a forum post...):
User supplies certain parameters, including Source and Target actors.
Geometry information for selected actors is gathered. The most important is the vertex coordinates, which are loaded into arrays for easier processing.
User-supplied parameters are used to generate vertex exclusion lists for both the Source and Target geometries.
Script loops through all Target vertices. If they aren't being screened by the exclusion list, it will process them.
The screening code by odf is used to further restrict which Source vertices will be considered as we proceed.
For each Target vertex, the script loops through all Source vertices, only considering those which are not, themselves, being screened.
Distance between Target and Source vertices is calculated. If this is within the range submitted by the user (as Cutoff Distance), the distance is logged to a Python dictionary, using the distance as key and the index as value.
The normals between each Source and Target vertex are optionally tested. Any Source vertex with normals which don't pass the test is not logged to the distance dictionary.
After looping through all Source vertices for each Target vertex, the distance dictionary contains all potential candidate vertices for a match.
A new loop is run, to sort through the distance data gathered and generate the vertex weights and finally the data file. This starts by sorting the keys of the dictionary, placing the closest vertices at the top of the list.
A user-submitted number (Number of Influences) of listings from this sorted distance list is then processed to find the weights.
A string containing the weight listing is logged to a Python list.
Once all Target vertices are processed, the list containing the weights is written out as the final .vmf data file.
The raycasting process being tested is run after the distance sorting but before weight generation. The raycasting uses the normal of each Target vertex to cast a ray which is then checked to see whether it intersects any of the polygons of the closest vertex from the distance list. If so, a string containing the weights from the intersection with a triangle derived from the intersected polygon is logged to the final list of strings. If there is a raycasting hit, no further processing is applied for that Target vertex. Spanki may enjoy elaborating upon the raycasting technique and its weight-generation methods. I'm afraid I may misrepresent it somehow if I try to go in-depth. Hopefully I haven't been inaccurate, as it is. 
===========================sigline======================================================
Cage can be an opinionated jerk who posts without thinking. He apologizes for this. He's honestly not trying to be a turkeyhead.
Cage had some freebies, compatible with Poser 11 and below. His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.