[Development] PyM2 (Python M2 ScriptLib) menu

User Tag List

Results 1 to 14 of 14
  1. #1
    Tigurius's Avatar Member
    Reputation
    300
    Join Date
    Jun 2008
    Posts
    519
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Development] PyM2 (Python M2 ScriptLib)

    I started writing a little library for accessing m2 files in python.


    script.py is an example script printing the texture filenames on the screen and correcting animation indices and lookup table.

    You need Python installed.

    SVN: script.py - pym2 - Project Hosting on Google Code
    Last edited by Tigurius; 04-26-2010 at 06:59 AM. Reason: it's finished
    Like my work? Support Me! ;D

    [Development] PyM2 (Python M2 ScriptLib)
  2. #2
    Xel's Avatar ★ Elder ★
    Authenticator enabled
    Reputation
    1179
    Join Date
    Jul 2008
    Posts
    2,906
    Thanks G/R
    94/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks again for an awesome release Tigurius.

    Thread Approved!

  3. #3
    Toyoka's Avatar Contributor
    Reputation
    139
    Join Date
    Nov 2009
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds interesting, I'll keep my eye on this!
    ~ "When you find it hard doing right in what you do, you've got a problem" ~

  4. #4
    Zantas's Avatar Contributor
    Reputation
    258
    Join Date
    Dec 2007
    Posts
    1,114
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome
    So lucky that you make in a language I kinda understand.


    Long live the snake!
    https://i45.tinypic.com/157df7r.jpg


  5. #5
    Tigurius's Avatar Member
    Reputation
    300
    Join Date
    Jun 2008
    Posts
    519
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So far, everything except *.anim files is implemented(so if you load models with *.anim files it may crash)
    Except of this exception, you can now use this.
    Examples:
    1.GeosetTypes:
    Code:
    from skin import *
    
    #Create Dictionary for Translating Ids
    GeosetTypes = { "00" : "Hairstyles", "01" : "Facial1", "02" : "Facial2", "03" : "Facial3",
    "04" : "Bracers", "05" : "Boots", "06" : "Unknown1", "07" : "Ears", "08" : "Wristbands", "09" : "Kneepads",
    "10" : "Unknown2", "11" : "Pants", "12" : "Tabard", "13" : "Trousers/Kilt", "14" : "Unknown3",
    "15" : "Cape", "16" : "Unknown4", "17" : "Eyeglows", "18" : "Belt" } 
    
    #Open SkinFile
    sk = SkinFile("VrykulMale00.skin")
    #Iterate through the Geosets
    for i in sk.mesh:
    	s = str(i.mesh_id)#Convert the GeosetId to a string
    	j = len(s)#Get the Length of the string
    	if (j<3):#If it's only two digits...
    		s = "00"#the Id is 00
    	elif(j<4):#if it's length is <4, then it has only one digit
    		s =  "0" + s[0]
    	else:#get the two important digits
    		s =  s[0:2]
    	print str(i.mesh_id) +" is " + GeosetTypes[s]#print mesh_id and it's translation
    2. Texture Types:
    Code:
    from m2 import *
    
    #Dictionary for Texture types
    TextureTypes = { 0 : "Hardcoded" , 1 : "Body/Clothes" , 2 : "Items", 3 : "ArmorReflect?", 6 : "Hair/Beard",
    8 : "Tauren fur", 9 : "Inventory Art 1", 10 : "quillboarpinata", 11 : "Skin for creatures or gameobjects 1",
    12 : "Skin for creatures or gameobjects 2" ,13 : "Skin for creatures or gameobjects 3", 14 : "Inventory Art 2"} 
    
    #open m2
    m2 = M2File("HumanMale.m2")
    #iterate through textures
    for i in m2.textures:
    	print "Type is " + TextureTypes[i.type]#print texture type
    	print i.name#print texture filename
    Last edited by Tigurius; 03-20-2010 at 10:10 AM. Reason: Added Examples
    Like my work? Support Me! ;D

  6. #6
    gorq's Avatar Member
    Reputation
    17
    Join Date
    Jul 2008
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how can i use it? I have python but no idea :S

  7. #7
    Tigurius's Avatar Member
    Reputation
    300
    Join Date
    Jun 2008
    Posts
    519
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Create a textfile called blah.py insert your program and start it via cmd
    Like my work? Support Me! ;D

  8. #8
    Demonshade's Avatar get in da van, i got epix

    Reputation
    494
    Join Date
    Mar 2007
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    awesome script! TY
    /AFK shower

  9. #9
    griwes's Avatar Member
    Reputation
    1
    Join Date
    Feb 2009
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What can we do with this - tried to understand, but you should start commenting code while writing (in lib). Anywhen possibility to convert it to other formats? :P

  10. #10
    Aryzar's Avatar Member
    Reputation
    67
    Join Date
    Mar 2009
    Posts
    134
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hope you're still working on this
    Last edited by Aryzar; 04-25-2010 at 11:32 AM.

  11. #11
    Tigurius's Avatar Member
    Reputation
    300
    Join Date
    Jun 2008
    Posts
    519
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, as it's finished.
    Like my work? Support Me! ;D

  12. #12
    Jordaldo's Avatar Member
    Reputation
    3
    Join Date
    Jun 2008
    Posts
    21
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how do I GET pym2? do i make the file myself, or do i download it somewhere?

  13. #13
    danielrhodea's Avatar Master Sergeant
    Reputation
    11
    Join Date
    Apr 2010
    Posts
    107
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi tigu, how would one go about calling multiple versions of your m2 (i.e. wotlk & cata). I think I found a script that performs a conversion between format but it imports four.m2, and I'm not sure how I would get your library to function in this way (btw this is the first time I've ever used python and am happy that I have added error checking to the script.py and moddler apps (and got them to run from svn, which they unfortunately do not!)

  14. #14
    equertez's Avatar Sergeant
    Reputation
    7
    Join Date
    Aug 2010
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey tigu do you can convert worgen.m2 from cataclysm to wotlk? (including *.anim and *.skin if you can please help me and the guide pls thanks also +rep if you help me

Similar Threads

  1. Developers
    By leoj in forum Suggestions
    Replies: 7
    Last Post: 05-03-2007, 08:35 AM
  2. Monthy Python reference
    By Marlo in forum World of Warcraft General
    Replies: 0
    Last Post: 04-22-2007, 01:43 PM
  3. New development content swap?
    By kBlaster in forum World of Warcraft Model Editing
    Replies: 5
    Last Post: 04-07-2007, 06:46 PM
  4. Cheat Engine the Movie(Development)
    By Wireless in forum World of Warcraft General
    Replies: 2
    Last Post: 01-26-2007, 01:49 AM
  5. Developer Island?
    By cyber_geek in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 09-17-2006, 04:28 AM
All times are GMT -5. The time now is 01:22 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search