Difference between revisions of "Nif Optimization"

296 bytes removed ,  20:10, 23 June 2012
Byline and one broken link removed
imported>Amorilia
(→‎FAQ: more nifs that don't work)
imported>QQuix
(Byline and one broken link removed)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Byline}}


[[Category:Modeling Tutorials]]
[[Category:Modeling Tutorials]]
[[Category:Tutorials]]
[[Category:Tutorials]]
Created by [[User:Razorwing|Razorwing]] from [http://www.silgrad.com/ Silgrad Tower]


==Background==
==Background==


My name is Razorwing from the [http://www.silgrad.com/ Silgrad Tower] team. If you're a 3D Studio Max modeller like me and haven't tried [http://niftools.sourceforge.net/forum/profile.php?mode=viewprofile&u=4 amorilia]'s script before you'll most likely want to read this information.
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.5] (in this article it will be assume that you use the default installation path, C:\Python25).
*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/project/platformdownload.php?group_id=199269&sel_platform=3089 PyFFI].
*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:\Python25\python.exe" "C:\Python25\Scripts\niftoaster.py" --pause optimize "%1"
  "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:\Python25\python.exe" "C:\Python25\Scripts\niftoaster.py" --pause -x NiMaterialProperty optimize "%1"
  "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:\Python25
  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.5", 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.
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
Anonymous user