Author Topic: Looking for a utility for models  (Read 373 times)

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Looking for a utility for models
« on: September 11, 2014, 11:27:38 pm »


               

Hi, all.


 


So the idea occurred to me today to start looking for either a small utility or a batch file that could do some work for me that would come in handy for hak mergers like myself.


 


There are lots of different clothing/robe/armor additions out there for NWN, and sometimes new ones are still made. The problem comes when merging haks...all those parts have multiple models for the different races/genders/phenotypes/etc. and if renumbering one, you have to both renumber the file names for the models and .plts, and all the internal references.


 


Does anyone have, or is anyone able to create, a simple to use utility (or even batch file) that would be able to take all the models/textures in a folder with a specified ending number (they're always 3 digits), rename them all with a new specified ending number, and do a find&replace to change all the internal references of said numbers?


 


I can do all this work myself with a renaming program I use and with a plain text editor, but it's multiple steps and takes a lot of time. It would probably make multiple people happy if there was a 1 or 2 click method to make the change with just inputing the starting and ending part numbers.


 


I'm not skilled enough to write something like this myself, so I'm wondering if something like this already exists or can be created by one of the computer people in the community.



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Looking for a utility for models
« Reply #1 on: September 11, 2014, 11:42:17 pm »


               

I think you need Ant Renamer Portable (can be used from a HD just as easily as from a usb stick). I've used it a lot (50 differently named textures don't become orderly on their own you know  '<img'> ).



               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Looking for a utility for models
« Reply #2 on: September 12, 2014, 12:34:59 am »


               

I've got a file renamer that works well, I was just hoping for something that would be one step to do everything. '<img'>



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Looking for a utility for models
« Reply #3 on: September 12, 2014, 01:14:04 am »


               

For the internal renaming have you looked at my "Silly little utilities"? There is one on there called "Mass Model Renamer". Beware this one can seriously screw up your models if you are not careful. Read tiny user manual before using.


 


TR



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Looking for a utility for models
« Reply #4 on: September 12, 2014, 03:36:00 am »


               

I have a bash (not batch) script which will do that on a Linux system. It uses command line tools like sed so it's not really portable however if you install cygwin or something else that provides bash and the other command line tools from a *nix system it could probably be made to work on windows. Let me know if you want it...



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Looking for a utility for models
« Reply #5 on: September 12, 2014, 10:27:41 am »


               

I use NWN Model Renamer for models and msdos rename for textures.



               
               

               
            

Legacy_Verilazic

  • Sr. Member
  • ****
  • Posts: 263
  • Karma: +0/-0
Looking for a utility for models
« Reply #6 on: September 18, 2014, 05:29:49 am »


               

I was thinking the same thing just a couple months ago, TAD. I think I'll go see what I can come up with. I'll be back with an update on my progress sometime next year... >.>


 


Edit because I didn't feel like sleeping yet.


 


Basically, at the minimum you want something that does the following:



Take file name "pxyn_<type><id>" and new part number <new>. Then search same directory and do the following:

1. Change file name "pxyn_<type><id>.mdl" to "pxyn_<type><new>.mdl".

2. Change file name "pxyn_<type><id>.plt" to "pxyn_<type><new>.plt".

3. Change all instances of "pxyn_<type><id>" within file "pxyn_<type><id>.mdl" to "pxyn_<type><new>".

4. Find file name "ipx_<type><id>" and change name to "ipx_<type><new>".

Does that about sum it up? Are there any exception cases for which that might not work?



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Looking for a utility for models
« Reply #7 on: September 18, 2014, 02:04:35 pm »


               


Does that about sum it up? Are there any exception cases for which that might not work?



 



 


Yes.   Many of the non-human models use the human PLT.  So you need to change  pmh0_<type><part> to the new number even if the file is pmo0_<type><part>.mdl.  I.e. you have to be less specific when doing at least the bitmaps. What I do is once I've  got the file I'm sure I want to change the replacement code uses a more inclusive match with essentially wild cards for xyn.



               
               

               
            

Legacy_Verilazic

  • Sr. Member
  • ****
  • Posts: 263
  • Karma: +0/-0
Looking for a utility for models
« Reply #8 on: September 19, 2014, 06:52:10 pm »


               

Guh. I thought it wouldn't be this difficult to put together a batch script, but it's stupid. I'd rather use perl or something else. >.< Any particular votes for a specific language/program?



               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Looking for a utility for models
« Reply #9 on: September 21, 2014, 05:59:20 am »


               


Guh. I thought it wouldn't be this difficult to put together a batch script, but it's stupid. I'd rather use perl or something else. >.< Any particular votes for a specific language/program?




Something that works on Windows 8.1? I'm in the middle of copying 7 years' worth of stuff over to a new laptop. '<img'>


               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Looking for a utility for models
« Reply #10 on: September 21, 2014, 12:25:39 pm »


               

@ad you do realise that a beta of windows 9 will be unveiled on the 30th of this month? As for something that works on windows 8 is concerned... I think that means it will need to be in some version of .net then (or maybe java or python) especially if its compiled on a non windows 8 machine.


 


TR



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Looking for a utility for models
« Reply #11 on: September 21, 2014, 03:58:13 pm »


               


@ad you do realise that a beta of windows 9 will be unveiled on the 30th of this month? As for something that works on windows 8 is concerned... I think that means it will need to be in some version of .net then (or maybe java or python) especially if its compiled on a non windows 8 machine.


 


TR




cygwin is free and gives you access on windows to all of (most of anyway) the unix/linux command line tools, among other things. That means it could be scripts that use those tools. In which case a working script is pretty straight forward to come up with.  Perl would also probably do this pretty easily and can run on windows. I don't see why you would need a compiled language program to do this.


               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Looking for a utility for models
« Reply #12 on: September 21, 2014, 09:15:44 pm »


               

It's been (mutters unintelligibly under breath) years since I've used unix and I've never seriously used linux (had a look at some distros), so I don't really know the state of modern shell scripts. Also I've never used perl. I do know a little about compiled languages, hence my post. BTW Python is interpreted (I thought that went out with the death of 8 bit computing) not compiled.


 


TR



               
               

               
            

Legacy_Verilazic

  • Sr. Member
  • ****
  • Posts: 263
  • Karma: +0/-0
Looking for a utility for models
« Reply #13 on: September 22, 2014, 04:21:27 pm »


               

Perl was my bane in school, but I have to admit my heart wasn't really in it then when I was trying to learn it. I'm up for giving it another shot, but only if it would be helpful for other people. Otherwise, I can look to see if Win8 has anything new (I'm running 7, hopefully waiting on 9), or try out unix through cygwin.