Jump to content

* * * * * 1 votes

Time to Level Up

blender meshimport

  • Please log in to reply
3 replies to this topic

#1 lefty2000


    Senior Member

  • Members
  • 109 posts
  • LocationGalveston Texas

Posted 19 May 2021 - 11:39 PM

About two years ago, one of the old boys from DCModding, Tarison, aka Niktatorship, reappeared here and invited us to  a discord channel for TM Underground that he had created. One night in a discord chat, he announced that Blender 2.80 was just released and he was anxious to try it on some of his projects. I also installed the thing and managed to convert an earlier version of my animation import scripts to run on Blender 2.80. I was bragging about it on the discord channel and Tarison decided to take a crack at rewriting the old 2.4 version of the mesh import script forBlender 2.80.


After a couple of evenings, Tarison produced a script he called tm_module_wrapper which provided an excellent start. At that point the script would run long enough to create a mesh object and adding the vertices before hitting an error and stopping. We kicked it around another night or two and Tarison decided not to pursue it. At that point the script would create the faces for the mesh object. The next section of code had to do with creating an armature and adding the bones.



The image above is a prop mesh mod imported from "The Movies."  The model was created by Beowulf71. 


I struggled with the coding for a little while, then gave up and put it aside until a week ago. I have a learned a trick or two in the last couple of years, so I decided to take another crack at tm_module_wrapper. So I dug out the script and tried running it. I don't have blender 2.80 on my computer anymore, but I do have 2.92, so I used that. The script ran exactly the same as it did on the earlier version. Before proceeding with the development, however, I decided to back up to blender 2.79 because that version still has the old blender render engine which is compatible with scenes created in blender 2.49b.


Dropping back to 2.79 proved fairly easy. Only a couple of minor changes were required before I had it running in 2.79 and could start to work on the code for adding the bones.  Using 2.79 for the development does not preclude upgrading to later versions because changes in the python api for blender between version 2.79 and the current version are relatively minor.  The big hurdle is getting from 2.49 to any later version.  The reason is that the python api was completely rewritten. 


Anyway, in the last couple of weeks I have made significant progress toward getting a python script that can be used to import mesh files from "The Movies" by Lionhead (RIP).


The next major goal in the development when I resumed work was to create a rig for Movies Game costume.  All the information needed to construct the rig is in the mesh file, so the approach was to convert the old script line by line. 




After a lot figgerin' and finaglin', today, I finally managed to generate an armature and attach all the bones.  The rig does not work at this point because the vertex groups and weights have not been setup, but at least all the bones are there, in place, and correctly named.


There is a bunch of stuff left to do, but I think I can finally see a light at the end of the tunnel. 


The fact that I am using an older version of blender does not preclude upgrading to run in later versions, since the changes to the python api are minor between 2.79 and 2.92.  Also, blender 2.79 incorporates python 3, so the language is compatible with later versions. 


If I can finish this, it should be feasible to upgrade the mesh export script to current blender versions as well.  My experience with developing the animation import scripts indicate that exporting is easier than importing due simply to one's expanding knowledge and understanding.


If you are wondering why I went to all this trouble to create a program that simply replicates an existing capability on another platform, I can tell you that I am doing it for the sheer thrill of the "ah ha!" moment when everything falls into place.  Also, I wanted to learn how to use the newer versions of blender.  Once you cross the line from 2.49b to 2.50, a whole new world opens up to you.


When I first saw woody appear on my 3d window in blender 2.79b, it reminded me of a familiar image.


If you would like to see it, google "Christ the Redeemer."

  • BiggsTrek likes this

#2 MikeDBoing


    Senior Member

  • Members
  • 420 posts
  • LocationEarth, Sol System

Posted 20 May 2021 - 03:11 AM

...is that angels singing in the background?......

Baby we were Boing to run.... 2660.jpg

#3 lefty2000


    Senior Member

  • Members
  • 109 posts
  • LocationGalveston Texas

Posted 03 January 2022 - 11:53 PM

Alpha testers needed!


A preliminary script bundle for TM modders is ready for user testing.   The bundle can be downloaded at http://lefty2000.com..._blender279.zip


The package contains a mesh import script and a mesh export script.  So far it has been tested on costume meshes only, but the results are promising.  For more information read the journal entry on my deviant art page at https://www.devianta...9b-902724090.  There is also a video demonstration of an earlier version of the scripts at https://www.devianta...-279b-902603308


#4 lefty2000


    Senior Member

  • Members
  • 109 posts
  • LocationGalveston Texas

Posted 14 January 2022 - 08:38 PM

Here is another update which fixes several problems with the blender 279 tm scripts and introduces a new tool, a partial conversion of tm_preflight which helps identify common problems with the model before you attempt to export.





Also, you can view a video demonstration of the latest package as I go through the process of making and testing a simple costume mod.



Also tagged with one or more of these keywords: blender, meshimport

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users