| 
		 Autoerotic Asphyxiation #1642 posted by killpixel  on 2019/08/06 21:47:25  
		 Victem Of Python #1643 posted by madfox  on 2019/08/07 02:31:17 >>>from qmdl import Helper
>>>knight = Helper()
 >>>knight.load("mymdl.mdl")
 Traceback (most recent call last):
 File "(stdin)", line 1, in module>
 File "C:\python32\lib\site-packages\qmdl\helper.py", line 18, in load
 with open(filename, "rb") as file:
 IOError: [Errno 2] No such file or directory: 'mymdl.md'
 
 
 In what directory should I set mymdl.mdl?
 
		 Chthon Model #1644 posted by metlslime  on 2019/08/08 19:16:58looks like someone is making a faithful model upres for Chthon: 
https://twitter.com/DanielWienerson/status/1157178572672364549 
		 Nipples? #1645 posted by Shambler  on 2019/08/08 23:28:25Many nipples!  
		 Madfox #1646 posted by Preach  on 2019/08/10 09:10:28Python looks for mymdl.mdl in your "current working directory". When you run a script by double-clicking it or running on the command line, the working directory is usually the folder that the script itself is located in. So try putting both the model and the script in the same folder.
 If you can't get that to work, you can try changing the line to include the full path to the model, like:
 knight.load("c:\models\cave-troll\mymdl.mdl")
 
		 Errno22 #1647 posted by madfox  on 2019/08/11 07:16:11Thanks for your attention, Preach. Sorry to interrupt for something that looks so simple, but python doesn't want my mdl files. It keeps returning the file don't excist by giving it another name. vlak.mdl is no x0blak.mdl, or do I invalid an argument here? 
Maybe I've got Pyhon wrong installed.
 
 
 >>> from qmdl.helper import Helper
 >>> knight = Helper()
 >>> knight.load("C:\python32\Lib\site-packages\qmdl\vlak.mdl")
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "C:\python32\lib\site-packages\qmdl\helper.py", line 18, in load
 with open(filename, "rb") as file:
 IOError: [Errno 22] Invalid argument: 'C:\\python32\\Lib\\site-packages\\qmdl\x0
 blak.mdl'
 >>>
 
 >>> from qmdl.helper import Helper
 >>> knight = Helper()
 >>> knight.load("C:\File\vlak.mdl")
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "C:\python32\lib\site-packages\qmdl\helper.py", line 18, in load
 with open(filename, "rb") as file:
 IOError: [Errno 22] Invalid argument: 'C:\\File\x0blak.mdl'
 >>>
 
 
		 Confusing Error Message #1648 posted by iw  on 2019/08/11 13:50:49madfox, a backslash in a Python string is treated as an escape character, which is why you're getting the weird error message.  "\v" is the escape sequence for a vertical tab, which is hex "0b", which is why you're seeing "\x0blak.mdl" (Python prefixes hex sequences with "\x" when displaying them).
 If you're using Python 3, you should be able to prefix the string with "r" to make it a raw string, like this:
 
 knight.load(r"C:\path\to\file.mdl")
 
 Alternatively, you could in theory escape the backslashes:
 
 knight.load("C:\\path\\to\\file.mdl")
 
 Alternatively, it sounds like Python will let you use forwardslashes instead of backslashes in Windows paths, at least in some circumstances, however I don't know if that would work with the module you're using.
 
		 Correction #1649 posted by iw  on 2019/08/11 14:03:52The "r" syntax for a raw string literal is also in Python 2, apparently.  
		 Py Thon #1650 posted by madfox  on 2019/08/12 03:31:37Thanks for your comment! 
 I've read somewhere PILL and PILLOW won't work together.
 They're both in my Python32, but I can't uninstall one or the other.
 Now I'm a bit confused between the next string and my totally lack of understanding the args. :P
 
 >>> knight.load(r"C:\python32\Lib\site-packages\qmdl\vlak.mdl")
 <qmdl.helper.Helper object at 0x00C2A550>
 >>> knight.append_skin("avlak.bmp")
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "C:\python32\lib\site-packages\qmdl\helper.py", line 310, in append_skin
 from PIL import Image
 ImportError: No module named PIL
 
 
		 No PIL Library #1651 posted by Preach  on 2019/08/13 22:39:22That's the error you get if PIL isn't installed. Try following the instructions at the top of the question posted as
https://stackoverflow.com/questions/43560898/import-image-using-pillow-no-module-named-pil  They should uninstall PIL and reinstall PILLOW, the person who posted the question eventually found that retrying the commands fixed his issue...  
		 Extract Skeleton Out Of QME Is it possible? I found some skeletal animations in mdl models in Navi seal mod and i would like to mess around with.  
		 Six-Shoota #1653 posted by ijazz2019  on 2019/08/17 15:13:39Excuse me?
Skeletal anims in QME?
 Are you sure?
 Quake engine uses vertex animation....it doesn't have bones that move,it tracks the movement of all vertices (if this wording is correct).
 
		
		
		ijazz2019, Yes it is true, but it sesms QME writes joint track info after the regular data in the mdl. Go download navy seal and take a look at pdude.mdl  
		 >>> #1655 posted by madfox  on 2019/08/21 00:49:53
>>> from qmdl.helper import Helper
 >>> knight = Helper()
 >>> knight.load(r"c:\python\Lib\site-packages\qmdl\vlak00.mdl")
 <qmdl.helper.Helper object at 0x0051AA70>
 >>> knight.append_skin(r"c:\python\Lib\site-packages\qmdl\avlak.bmp")
 <qmdl.helper.Helper object at 0x0051AA70>
 >>>
 
 So far so good, but nothing has chanded the model.
 Or am I looking to a repeat of the mdl command
 and no append_skin excist?
 
		 Madfox #1656 posted by Preach  on 2019/08/21 21:57:49You need to put a command at the end to save the model again
 knight.save(r"c:\python\Lib\site-packages\qmdl\vlak01.mdl")
 
 I tend to use a different filename for the input and the output of my scripts so I can see the difference (and so I have a backup if there's a bug in my script!). But you can use the same filename if you prefer.
 
		 Yes! #1657 posted by madfox  on 2019/08/22 02:01:44I helped myself out trying some kids tuts for python. Soon it looks as if my turtle.forward comes out square, but that's the end of the line. Every other way of statement ends up wined so my setup isn't right. 
 I did get a next mdl though. What I'm trying is to make a simpel square of four vertices, add a skinfile with an alpha and see if it comes out transparant in Quake. (If it would be that easy).
 
 Now I end up with a new mdl file what I can't detect, as qmle nor noesis identifies it as a commen mdl. It must be the 32 bit bmp file what blocks.
 
		 Error #1658 posted by Preach  on 2019/08/23 00:30:27Could you upload the script, model and skin somewhere for me? It sounds like there's a bug in my code if its outputting an illegal model.  
		 So #1659 posted by madfox  on 2019/08/23 16:34:45mdl
 
 Redfield, how did you manage that pinetrees?!  
		 A Fix And A Bug #1660 posted by Preach  on 2019/08/23 23:25:32I quickly noticed the big issue here - your skin file doesn't have the correct width/height for the model. The script assumes that you supply a correctly sized skin, and doesn't attempt to resize it or even warn you.
 However, once I tried adjusting your skin to match the model, I discovered there is a bug in qmdl I can't quite nail down. Even if the image dimensions matches the image, it seems that the skins don't load correctly if the dimensions are not multiples of 4. Can't nail down exactly what's causing that, so I recommend:
 
 1) resize the model's skin to a size that's a multiple of 4 in each direction, e.g 128 by 64.
 2) change the skin to match the dimensions of the model
 
 I got the import to work with your script after those steps. I'll see if I can investigate the bug further now...
 
		 No Bug 8bit Limit #1661 posted by madfox  on 2019/08/24 02:38:45I adjusted the skin to 128 x 64 and it turns out a usefull mdl. 
  Nothing wrong with the code.
  I think the reason it turns out with a scattered skinfile is because it is converted back to the 8bit quake.pal. 
 
 Here  is my result.  
		
		
		is there a q1/q2 export for Blender 2.8?  
		 See Example #1663 posted by madfox  on 2019/08/26 18:23:05 
		
		
		That doesn't work with Blender 2.8.  
		 Ha! #1665 posted by madfox  on 2019/08/26 21:41:45Great, I use Blender v2.6
  Take a look at endeavor's  tutorial  Maybe you can use the export plugins.  
		 Blender #1666 posted by Preach  on 2019/08/27 08:19:32I remember being annoyed when I wrote a MDL export plugin for an earlier version of Blender, and the next version changed the APIs I was relying on. Puts you off maintaining it...
  What I often recommend for creating MDL files is a two stage process - export from your model editor into a more commonly supported format, and then convert that to MDL. I have a tool that support conversion 
  from MD3 to MDL:
 https://tomeofpreach.wordpress.com/md3tomdl/  or from FBX to MDL:
 https://tomeofpreach.wordpress.com/qmdl/fbxtomdl/  Hopefully one of those routes is possible from the version of Blender you use.  |