Page 4 of 4 FirstFirst 1234
Results 91 to 108 of 108

Thread: texture/dds converter

  1. #91
    Join the ICLADOLLABOJADALLA! Member IrishArmenian's Avatar
    Join Date
    May 2006
    Location
    Writing the book, every day...
    Posts
    1,986

    Default Re: texture/dds converter

    Got it to work!
    Is there a .dds plug in for GIMP?

    "Half of your brain is that of a ten year old and the other half is that of a ten year old that chainsmokes and drinks his liver dead!" --Hagop Beegan

  2. #92

    Default Re: texture/dds converter

    Totally new to the MTW world and I am trying my hand at modding since I seem to have a knack for graphics and photoshop..

    But first and most importantly, I have to say THX to Alpaca for all of his unheralded work and advice(as well as patience....I have been reading these forums and I am shocked at the rudeness and selfishness of some people.) Love ya for all your time and creativeness

    My question is.....Does it matter which dxt1 format I save in? One is 'no alpha' and the other '1 bit' I believe. My attempts at texture overlay editing renders me an 'all or nothing' kinda look. The changes are too subtle or the units look like they were wrestling in paint. I was wondering if this was a particular way that DX renders it's overlays or what was really happening....

    Any advice or suggestions would be greatly appreciated and rewarded anyway I can.

    Thx again,
    ~=]o Storm

  3. #93
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: texture/dds converter

    Quote Originally Posted by S+ORM8R!NG3R
    Totally new to the MTW world and I am trying my hand at modding since I seem to have a knack for graphics and photoshop..

    But first and most importantly, I have to say THX to Alpaca for all of his unheralded work and advice(as well as patience....I have been reading these forums and I am shocked at the rudeness and selfishness of some people.) Love ya for all your time and creativeness
    Awww, shucks

    My question is.....Does it matter which dxt1 format I save in? One is 'no alpha' and the other '1 bit' I believe. My attempts at texture overlay editing renders me an 'all or nothing' kinda look. The changes are too subtle or the units look like they were wrestling in paint. I was wondering if this was a particular way that DX renders it's overlays or what was really happening....

    Any advice or suggestions would be greatly appreciated and rewarded anyway I can.

    Thx again,
    ~=]o Storm
    I don't really know. The converter only does what some people did manually before which is strip the file header and rewriting it when you reconvert.
    I think you should always use the version that contains an alpha layer, but you can also try with DXT5

  4. #94

    Default Re : texture/dds converter

    Hi
    I need to know ; (after editing the original dds file with adobe) ...and saving the file to a new dds (modified), which option to check in nvdia box option

    where it says by default DXT1 RGB 4 bpp | no alpha (is that correct ?)

    because the file I save is Half smaller than the original one .

    thanks

  5. #95
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Re : texture/dds converter

    Quote Originally Posted by kungfuserge
    Hi
    I need to know ; (after editing the original dds file with adobe) ...and saving the file to a new dds (modified), which option to check in nvdia box option

    where it says by default DXT1 RGB 4 bpp | no alpha (is that correct ?)

    because the file I save is Half smaller than the original one .

    thanks
    If you need the alpha (transparency) information, save as DXT5 - otherwise save as DXT1
    The game understands both formats, as does the converter.

  6. #96
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: texture/dds converter

    Hi.
    Thanks Alpaca by this great tool.
    I've used it several times with no problems, but now when I try to convert a texture I get an error message like this (it is translated from Spanish and perhaps it is not exact):

    Unable to find MSVCR71.dll
    Perhaps the reinstallation of the application would solve this problem.

    Which application? Python?

    I don't remember what I did from the last time I used the converter, but probably I installed the last Nvidia plugins (dds and nomal maps). Can it be the origin of the problem? How can I solve this?

    Thanks in advance.

    Edit: I've solved this problem by copying this file in system32 from other directory.
    Last edited by Monkwarrior; 11-10-2007 at 10:52.

  7. #97

    Default Re: texture/dds converter

    Hi.
    I cant dl the " texture/dds converter" file from the link.
    Consideringits been a while since the file "release" date, Id like to know if you have deleted it. Can I find it anywhere else pls? Or is it my fault I cant dl it?

  8. #98
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: texture/dds converter

    Quote Originally Posted by Vasileiosthe2nd
    Hi.
    I cant dl the " texture/dds converter" file from the link.
    Consideringits been a while since the file "release" date, Id like to know if you have deleted it. Can I find it anywhere else pls? Or is it my fault I cant dl it?
    Yeah looks like the link is down. I updated the first post with a link to the TWC:
    http://www.twcenter.net/forums/downl...o=file&id=1347

  9. #99

    Default Re: texture/dds converter

    Dammit, you are almost always here and there to help others. Many kudos for ya alpaca, I really appreciate what you "efforts" and thank you.

  10. #100
    Ranting madman of the .org Senior Member Fly Shoot Champion, Helicopter Champion, Pedestrian Killer Champion, Sharpshooter Champion, NFS Underground Champion Rhyfelwyr's Avatar
    Join Date
    Oct 2006
    Location
    In a hopeless place with no future
    Posts
    8,646

    Default Re: texture/dds converter

    How would I add a banner to the Normans, rather than editing the one they already use, as that would mean changing the English banner ingame as well?

    EDIT: I've made a new banner for the normans, converted it to texture file, put it in the right folder. But how do I set the normans to use this rather than the English banners?

    EDIT: Never mind got that working. Now I need to sort out how to edit the faction icon that appears when selecting a faction for campaign/custom battles...
    Last edited by Rhyfelwyr; 12-17-2007 at 16:38.
    At the end of the day politics is just trash compared to the Gospel.

  11. #101

    Default Re: texture/dds converter

    Hi

    I'm converting some of my old RTW models to M2TW.
    It seems that there's something wrong with alpha channels, since it remains a sort of black border around the pieces cut with alpahs ...do you know a way to resolve that problem? ...maybe something related to the options to check using nvidia dds plug-in?

    Thanks in advance.

    project creator & director

  12. #102
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: texture/dds converter

    Sorry, I have no idea really. I didn't work with graphics a lot.

  13. #103

    Default Re: texture/dds converter

    doesn't work for me! i have python and after running any of the bats it says pause and press any key to continue.

  14. #104

    Default Re: texture/dds converter

    I have the same problem as Methyl Orange. I have no .py file in the directory either, how do I create / find that?

  15. #105

    Default Re: texture/dds converter

    I can't edit posts for some reason, but anyway, scratch the last post, I do have the .py document, but when I run the batch file, python doesn't open, and it just says pause and press any key to continue... What do I do!?!?!?! D:

  16. #106

    Default Re: texture/dds converter

    Quote Originally Posted by IrishArmenian View Post
    Hello everyone,

    I'm having a problem with the texture converter. Everytime I try to run it, it gives me the "Press any key to continue" command. As instructed, I press any key (normally the enter key) and the window closes, without any changes.

    More information (I assume this can help): I am running convert_all_textures.bat, I have python, and the file is texture_converter_01 in my data file.
    I have the same problem! How did you solve it? Can somebody help?

  17. #107

    Default Re: texture/dds converter

    Quote Originally Posted by salocin View Post
    I have the same problem! How did you solve it? Can somebody help?
    I'm not sure whether this thread is abandoned or not, but I figured out how to fix this issue.

    Problem is related to path in Python script used by Batches in order to either convert to DDS or to texture. Argument which represents path is initialized with '' and that gives no sense during execution, so you get an error.

    I edited script and fixed everything. Grab it:

    Code:
    # texture_converter.py version 0.1 (c) 2006 Stefan Reutter (alpaca)
     
    import sys
    import struct
    import os
    import math
     
    def convertTextureToDDS(path):
        f = open(path + '.texture', 'rb')
        fw = open(path + '.dds', 'wb')
        content = f.read()
        fw.write(content[48:])
        f.close()
        fw.close()
       
    def convertDDSToTexture(path):
        f = open(path + '.dds', 'rb')
        content = f.read()
       
        init = [0x01000000, 0x30000000, 0x00000000]
       
        # note: attachment sets don't seem to be used
        normHeader = [0x0044E212, 0x00986212, 0x03C0DA12]
        fill = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x56, 0x3A, 0x7C, 0x03, 0x00, 0x00, 0x00]
       
        dxt = -1
       
        size = content[12:16]
        if content[84:88] == 'DXT5':
            dxt = 16384
        elif content[84:88] == 'DXT1':
            dxt = 4096
       
        if dxt == -1:
            print 'File '+path+' could not be converted'
        else:
            fw = open(path+'.texture','wb')
            for i in init:
                fw.write(struct.pack('>i', i))
            fw.write('dds')
       
            for i in normHeader:
                fw.write(struct.pack('>i', i))
            fw.write(struct.pack('h',dxt))
            for i in fill:
                fw.write(struct.pack('>b', i))
            fw.write(size)
            fw.write(content)
            fw.close()
        f.close()
       
       
       
       
       
       
    # Main script code
     
    convertAll = False
    subdirectories = False
    verbose = False
     
    files = []
     
    for i in sys.argv[1:]:
        if i.startswith('-'):
            i = i.strip('-')
            if i.lower().find('type') > -1:
                type = i.lower().split('=')[1]
            elif i.lower() == 'all' > -1:
                convertAll = True
            elif i.lower() == 'sub' > -1:
                subdirectories = True
            elif i.lower() == 't' or i.lower() == 'texture':
                type = 'texture'
            elif i.lower() == 'd' or i.lower() == 'dds':
                type = 'dds'
            elif i.lower() == 'v' or i.lower() == 'verbose':
                verbose = True
            elif i.lower() == 'h' or i.lower() == 'help':
                print """alpaca''s MTW2 .texture converter, version 0.1
               
               usage: texture_converter.py [options] files
               
               options:
               -all: Converts all files, if this option is supplied, filenames can be omitted
               -d,--dds: Convert .dds to .texture
               -h,--help: Display this page
               -sub: Also convert all files in all subfolders, can only be used with -all
               -t,--texture: Convert .texture to .dds (default, can be omitted)
               -v: Verbose option, extra output"""
        else:
            files.append(i)
           
    if type == 'dds' or type == 'd':
        if convertAll:
            if subdirectories:
                # Changed os.walk() arg from '' to os.getcwd() to get working directory.
                for tup in os.walk(os.getcwd()):
                    for filepath in tup[2]:
                        if filepath.find('.dds') > -1:
                            files.append(os.path.join(tup[0], filepath.split('.dds')[0]))
            else:
                # Changed os.walk() arg from '' to os.getcwd() to get working directory.
                for filepath in os.listdir(os.getcwd()):
                    if filepath.find('.dds') > -1:
                        files.append(filepath.split('.dds')[0])
            i = 0
            perc = 0
            perc2 = 0
            for filepath in files:
                if math.floor(i*100/len(files)) > perc:
                    perc = math.floor(i*100/len(files))
                if verbose:
                    print 'Converting file '+filepath+'.dds('+str(i+1)+' of '+str(len(files))+') - '+str(perc)+'%'
                elif perc > perc2:
                    print str(perc)+'% done'
                    perc2 = perc
                convertDDSToTexture(filepath)
                i += 1
        else:
            i = 0
            perc = 0
            perc2 = 0
            x = 0
            for filepath in files:
                if math.floor(i*100/len(files)) > perc:
                    perc = math.floor(i*100/len(files))
                if verbose:
                    print 'Converting file '+filepath+'.dds('+str(i+1)+' of '+str(len(files))+') - '+str(perc)+'%'
                elif perc > perc2:
                    print str(perc)+'% done'
                    perc2 = perc
                convertDDSToTexture(filepath)
                i += 1          
    else:
        if convertAll:
            if subdirectories:
                # Changed os.walk() arg from '' to os.getcwd() to get working directory.
                for tup in os.walk(os.getcwd()):
                    for filepath in tup[2]:
                        if filepath.find('.texture') > -1:
                            files.append(os.path.join(tup[0], filepath.split('.texture')[0]))
            else:
                # Changed os.walk() arg from '' to os.getcwd() to get working directory.
                for filepath in os.listdir(os.getcwd()):
                    if filepath.find('.texture') > -1:
                        files.append(filepath.split('.texture')[0])
            i = 0
            perc = 0
            perc2 = 0
            for filepath in files:
                if math.floor(i*100/len(files)) > perc:
                    perc = math.floor(i*100/len(files))
                if verbose:
                    print 'Converting file '+filepath+'.texture('+str(i+1)+' of '+str(len(files))+') - '+str(perc)+'%'
                elif perc > perc2:
                    print str(perc)+'% done'
                    perc2 = perc
                convertTextureToDDS(filepath)
                i += 1
        else:
            i = 0
            perc = 0
            perc2 = 0
            x = 0
            for filepath in files:
                if math.floor(i*100/len(files)) > perc:
                    perc = math.floor(i*100/len(files))
                if verbose:
                    print 'Converting file '+filepath+'.texture('+str(i+1)+' of '+str(len(files))+') - '+str(perc)+'%'
                elif perc > perc2:
                    print str(perc)+'% done'
                    perc2 = perc
                convertTextureToDDS(filepath)
                i += 1
    print 'Done'
    Then replace contents of your script with this one and use converter as usual.
    I also commented what has been changed.

    Enjoy I suppose.

    Member thankful for this post:

    Ludens 


  18. #108
    Arrogant Ashigaru Moderator Ludens's Avatar
    Join Date
    Nov 2003
    Posts
    9,058
    Blog Entries
    1

    Lightbulb Re: texture/dds converter

    Welcome to the .Org, and thanks for letting us know your solution.

    Looking for a good read? Visit the Library!

Page 4 of 4 FirstFirst 1234

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO