How-To: Install Blender nifscripts on a Mac

Flintlock1415

Emperor
Joined
Feb 24, 2008
Messages
1,057
Location
MN
For anyone whos interested, I've decided to make a tutorial on how to run the Blender nifscripts on a mac. This, alongside nifskope, Macapaka, and my skinning tutorial should be the final step in 3-D modelling for civ 4 on mac computers.

Here is what you'll need:

Python 2.5 (four paragraphs down under download the release section)
Blender 2.48a (python 2.5 version)
PyFFI(the .zip file)
The Nifscripts (again the .zip file)
Tinkertool

Okay, Lets start:
Open up Tinkertool and check show hidden and system files, and relaunch Finder. Don't mess around with your files! Once your done you will need to return to regular mode!
Then right-click (control-click if your mouse has one button) on Blender and choose 'show package contents'
Open contents/MacOS/.Blender/scripts/bpymodules.

Next open up the PyFFI-1.2.0 folder and take the folder named 'PyFFI" and drop it in the .../bpymodules directory.

Open up the nifscripts folder and take out nif_import.py and nif_export.py
Place these in contents/MacOS/.Blender/scripts (NOT bpymodules).

DON'T SKIP THIS STEP!
Go back to Tinkertools and UNCHECK 'show hidden and system files' and relaunch the finder.

Then open Blender from the folder (it has to be the blender you modified) and open up the text editor.
Choose 'text open' and find nif_common.py in YOURNIFSCRIPTSFOLDER/scripts/bpymodules.
Choose nif_common and select open text file.
Enable python text plugins and press ' Alt-P' to run the script.

Next open the scripts window and press 'Scripts'-"Update Menus"
Go back to 3-D view (I deleted the cube, but thats just my preference) and go to 'file'-"save default settings" to lock in the nif_common.py script.

And there you go! Now your mac is capable of editing models for Civ 4! :king:

p.s. here are some links for the tutorial thread index, Nifskope, Macapaka, and Blender Noob to pro.

Tutorial Thread Index
Nifskope
Macapaka
Blender: Noob to Pro Wiki

Please tell me if something is missing, you need help, or just want to leave a comment!
 
Hey,

Okay, I need some help here. I downloaded the programs you said, and ran the install procedure for PyFFI (which you don't specifically mention, perhaps I shouldn't have done this?).

I get to here okay:

YOURNIFSCRIPTSFOLDER/scripts/bpymodules

What path are you referring to here? I have ~/.blender/scripts/bpymodules and I have PathToDownloadedNifScripts/scripts/bpymodules, both of which have a nif_common.py.

However, when I try to run either of them with alt-P I get an error saying PyFFI not found, and it chokes on a line like:

from pyFFI import __version__ as __pyffiversion__

Yet from the terminal my python has no problem with this import call. My guess is that somehow blender's path isn't configured correctly to find pyFFI? Any ideas?
 
Hey,

Okay, I need some help here. I downloaded the programs you said, and ran the install procedure for PyFFI (which you don't specifically mention, perhaps I shouldn't have done this?).
Yes, do not run the install script, you don't need it. Just open the downloaded folder (PyFFI-1.2.0) and place the folder named PyFFI (which is inside PyFFI-1.2.0) and place it in /.blender/scripts/bpymodules

Hey,

I get to here okay:

YOURNIFSCRIPTSFOLDER/scripts/bpymodules

What path are you referring to here? I have ~/.blender/scripts/bpymodules and I have PathToDownloadedNifScripts/scripts/bpymodules, both of which have a nif_common.py.

However, when I try to run either of them with alt-P I get an error saying PyFFI not found, and it chokes on a line like:

from pyFFI import __version__ as __pyffiversion__

Yet from the terminal my python has no problem with this import call. My guess is that somehow blender's path isn't configured correctly to find pyFFI? Any ideas?
Hopefully the above should fix this,
hmm I don't a nif_common.py in the /.blender/scripts/bpymodules path; so open the one out of PathToDownloadedNifScripts/scripts/bpymodules
Hopefully this is more clear!
 
Sweet. I just had the wrong version of Blender downloaded (despite your instructions clearly saying the 2.5 version I'd grabbed the 2.3 version). Now we've got a complete set of modding tools for the Mac.
 
Sweet. I just had the wrong version of Blender downloaded (despite your instructions clearly saying the 2.5 version I'd grabbed the 2.3 version). Now we've got a complete set of modding tools for the Mac.

lol :lol: Glad to see your okay now and happy modding!
We can call it a complete set once I get the dds plugin working for GIMP (not that its necessary, but it'll make texturing a whole lot easier!) :crazyeye:
Ugh, maybe next weekend :sleep:
 
I don't get what to do to run the nif_common.py. I can't find something to allow the script to be run in textedit... Thanks!
 
you run nif_common.py in blender, not text edit. To get to the text editor screen, there is a button about 3/4 down the very left side of the screen. (it looks like a grid.) Click on this, which will bring up a menu, and choose text editor. Then load the script up and run it.
Hope this helps!
 
Thanks, but I also couldn't find something that said enable python text plugins. I did the rest, but was it right?
 
ok, but when I tried to run it it said my pyffi was outdated. Thanks for your help!
 
Good work! I'd like to point out a source for getting acquainted with Blender: http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro. Sensing problems for newbies I recommend using Blender as is while reading/skimming through this online book. Get to the parts with pictures and get comfortable with Blender before modifying it. Also, an alternative for text editing is Dashcode. (Located in your Mac's Developer/Applications) It requires developer's tools installed but it will be the default editor for XML files. (Just double click on one of your mod's XML files to open it in Dashcode.)
 
Thanks! Nice to see another person using this. :) I've used the noob to pro wiki extensively; its very helpful. I'll add it to the first post. :goodjob:

I did a spotlight search for Dashcode (I have the Dev tools), but it came up with nothing. Is it new to Leopard or something? I like to use Smultron for XML and python editing (check the mac modding index in my sig for it.) :cool:
 
I think Dashcode may be part of the iPhone developer kit. Its primary goal is to support the development of Mobile Safari web applications.
 
Thanks for the tip on Smultron. I just downloaded it and tried it out. Looks like another good free alternative to go with TextWrangler. Dashcode is part of Xcode Tools (on the install disk) and you may have to choose it when installing Xcode/Developer Tools. It is designed for making widgets for Dashboard. For modding Civ though, I prefer BBEdit. Reading this thread makes me wonder about one listing various tools for modding civ on a Mac: Smultron or TextWrangler for XML, Squish for .dds conversion, etc. I just got done compiling nifskope from source (not for the feint of heart.) Uff duh!
 
I have used Textedit, but sometimes when I load a file (i.e. Civ4Techinfos.xml) the tags would all be in a straight line rather than returned and tabbed, so I found Smultron. I don't feel like buying BBEdit, but I guess it would be nice to try out. :dunno: :p

As for Nifskope, did they come out with a new version? We already have one version on the forum, so I wonder why you compiled it yourself. :crazyeye:
 
Okay now for the dumb questions of the day. I'm finally getting around to doing this tutorial. I've downloaded python as per instructions. Do I have to install it? After I run the script in the nif_common.py section, will I be keeping the nifscripts folder? (I created a disk image to store that folder and other items in your list. Once I run the script and eject the disk it will be inaccessible.)
 
Just run the .mpkg that is in the download for python. Since the script will be in locked into the text editor, I don't think you'll need the folder after your done.
Just make sure you have the Pyffi, nif_import, and nif_export all in the correct place, and once you run the script, you will not be able to move your modified Blender.app from wherever you choose to place it.
I have mine located in a folder on my Desktop, but you could put in your Documents, should be able to work w/ applications, or anywhere else you want.
 
Thanks. I failed to mention that I'm have Leopard which comes with a python 2.5.1 installation. The Leopard instructions found here: http://wiki.python.org/moin/MacPython/Leopard installs only the PythonApplications-2.5.pkg inside the main pkg. I'm thinking I don't have to do anything unless blender needs something from this.
 
Back
Top Bottom