Difference between revisions of "Nif Optimization"
Byline and one broken link removed
imported>Amorilia (→Command Line Options: reorganized a bit; added a few new options) |
imported>QQuix (Byline and one broken link removed) |
||
(7 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Modeling Tutorials]] | [[Category:Modeling Tutorials]] | ||
[[Category:Tutorials]] | [[Category:Tutorials]] | ||
==Background== | ==Background== | ||
If you're a 3D Studio Max modeller and haven't tried amorilia's script before you'll most likely want to read this information. | |||
First I'll make a run-of-the-mill disclaimer that you're using this method at your own risk. It's not tested 100% and could cause you problems. All I can say is that I've used it quite a lot myself and haven't experienced any problems at all. | First I'll make a run-of-the-mill disclaimer that you're using this method at your own risk. It's not tested 100% and could cause you problems. All I can say is that I've used it quite a lot myself and haven't experienced any problems at all. | ||
Line 36: | Line 32: | ||
To get the script to work you need Python and PyFFI. Python is an open source programming language, while PyFFI is an interface between Python and nif files. | To get the script to work you need Python and PyFFI. Python is an open source programming language, while PyFFI is an interface between Python and nif files. | ||
*Install [http://www.python.org/download/ Python 2. | *Install [http://www.python.org/download/ Python 2.6] (in this article it will be assume that you use the default installation path, C:\Python26). | ||
*Install [http://sourceforge.net/ | *Install [http://sourceforge.net/projects/pyffi/files/ PyFFI]. | ||
==Using the Script from the Windows Explorer== | ==Using the Script from the Windows Explorer== | ||
Line 59: | Line 55: | ||
In the text box under "Application used to perform action", you see this text string: | In the text box under "Application used to perform action", you see this text string: | ||
"C:\ | "C:\Python26\python.exe" "C:\Python26\Scripts\niftoaster.py" --pause optimize "%1" | ||
You can add new options between <tt>--pause</tt> and <tt>"%1"</tt>, for instance: | You can add new options between <tt>--pause</tt> and <tt>"%1"</tt>, for instance: | ||
"C:\ | "C:\Python26\python.exe" "C:\Python26\Scripts\niftoaster.py" --pause -x NiMaterialProperty optimize "%1" | ||
if you do not want the script to optimize NiMaterialProperty blocks when you run it from the context menu. | if you do not want the script to optimize NiMaterialProperty blocks when you run it from the context menu. | ||
Line 75: | Line 71: | ||
*Open the start menu in Windows and select Run ([http://s11.photobucket.com/albums/a177/SilgradTower/AmoriliasScript/RunOnStartMenu.jpg img]). In the popup, write cmd and hit enter ([http://s11.photobucket.com/albums/a177/SilgradTower/AmoriliasScript/cmd.jpg img]). Now a Windows shell with command prompt will appear. [[Image:PythonScriptInDos.jpg|thumb| This is what the DOS window should look like if using the default commands.]] | *Open the start menu in Windows and select Run ([http://s11.photobucket.com/albums/a177/SilgradTower/AmoriliasScript/RunOnStartMenu.jpg img]). In the popup, write cmd and hit enter ([http://s11.photobucket.com/albums/a177/SilgradTower/AmoriliasScript/cmd.jpg img]). Now a Windows shell with command prompt will appear. [[Image:PythonScriptInDos.jpg|thumb| This is what the DOS window should look like if using the default commands.]] | ||
*Type | *Type | ||
cd C:\ | cd C:\Python26 | ||
followed by enter, to tell the Windows shell to go to your Python install folder. If you did not install Python in the default location then just replace the folder with your Python install folder. If you are unsure about where Python is installed, open the start menu then go to "Programs > Python 2. | followed by enter, to tell the Windows shell to go to your Python install folder. If you did not install Python in the default location then just replace the folder with your Python install folder. If you are unsure about where Python is installed, open the start menu then go to "Programs > Python 2.6", right-click any of the shortcuts and choose properties. Open the Shortcut tab, where the Python path is displayed in the "Target:" textbox. Write that url in your DOS window in the same format as the example. | ||
*Next, type | *Next, type | ||
python.exe Scripts\niftoaster.py optimize C:\nifoptimize | python.exe Scripts\niftoaster.py optimize C:\nifoptimize | ||
Line 135: | Line 131: | ||
**rocks | **rocks | ||
*''So, are there any meshes that I should not run with the optimizer?'' In principle, the optimizer is intended to work with any nif, but of course not every nif has been tested and there might be corner cases where the optimizer will not work, or even corrupt your nif. These are known not to work: | *''So, are there any meshes that I should not run with the optimizer?'' In principle, the optimizer is intended to work with any nif, but of course not every nif has been tested and there might be corner cases where the optimizer will not work, or even corrupt your nif. These are known not to work: | ||
** | **hair | ||
**helmets | |||
**some creatures | |||
**some clothes | |||
**any nif that has an .egm associated with it |