Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Far Cry 3|4

Post questions about game models here, or help out others!
User avatar
TheDude
mega-veteran
mega-veteran
Posts: 239
Joined: Sun Mar 20, 2011 7:35 pm
Has thanked: 29 times
Been thanked: 59 times
Contact:

Re: Far Cry 3|4

Post by TheDude »

Update: viewtopic.php?p=101460#p101460

• Removed NumPy from the Maya importer - should improve compatibility
• Added rough support for Far Cry 2 and Avatar (FC2 still needs some work)
• Made a WIP importer for Softimage (no materials yet)
• Sat in a deck chair in my underwear in front of a black velvet painting of a sad crying clown in an iron lung and laughed hysterically for 10 minutes
• Made a WIP importer for Blender 2.73
• Kicked some Geese in the face
• Made a WIP importer for Lightwave
• Made a WIP importer for Noesis
• Made a very rough importer for Houdini (just imports a singe object, not too useful yet)

Maya is still the best of the lot, but Softimage is close behind.
I'll work on this junk again sometime in January.
RunaWhite
veteran
Posts: 158
Joined: Sat Jan 07, 2012 2:30 pm
Has thanked: 56 times
Been thanked: 33 times

Re: Far Cry 3|4

Post by RunaWhite »

I am curious: is the issue for Pagan Min still there, or he can be imported correctly now?
User avatar
TheDude
mega-veteran
mega-veteran
Posts: 239
Joined: Sun Mar 20, 2011 7:35 pm
Has thanked: 29 times
Been thanked: 59 times
Contact:

Re: Far Cry 3|4

Post by TheDude »

I just fixed a big problem with the materials.
I'll check that out next.
(Python indentation is going to be the death of me!)
Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 742 times

Re: Far Cry 3|4

Post by Szkaradek123 »

......(Python indentation is going to be the death of me!)..........

My favorite text editor is Notepad++.
All scripts write in this editor.
I open script in Blender and Notepad++. When save script in notepad++, in Blender text window menu create red icon for reload a text.
And for python indentation select text block and use tab key or lshift+tab for transform this block.
Use always tab not space key.
User avatar
TheDude
mega-veteran
mega-veteran
Posts: 239
Joined: Sun Mar 20, 2011 7:35 pm
Has thanked: 29 times
Been thanked: 59 times
Contact:

Re: Far Cry 3|4

Post by TheDude »

Thanks Szkaradek.
I usually use Notepad++, but I still managed to mess up a block of code somehow.
I didn't even know about the text reload option in Blender. And I totally agree with the tab thing.
With the hap-hazard way I go about coding, spaces mess me up - I pretty much have to use tabs.

A bit off topic, but how much do you know about importing animation into Blender?
Models are no problem, but when I tried to import animation into Blender it wouldn't work for anything.
I tried every type of space transform I could think of.
Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 742 times

Re: Far Cry 3|4

Post by Szkaradek123 »

Code: Select all

About animations:
I know we have 2 methods to get position of bone in every frame.
 - method ARMATURESPACE - it is transform bone relative to skeleton
 - method BONESPACE - it is tranform bone relative to bone parent

For transform bone we have:
 - eulers and quaternions - for rotation
 - vectors - for position 
 - matrices - rotation, position and scale in one math object
 
 
 
 I use in most cases matrices 4x4. I try all convert to this matrices.
 How convert:
 posmatrix = convert vector to matrix4x4
 rotmatrix = convert euler to matrix4x4 or convert quaternion to matrix
 Blender use for quaternions: w,x,y,z  like  1,0,0,0
 But when import quat from game we get for this case x,y,z,w : 0,0,0,1, 
 so we need convert gamequat to blenderquat (translate value w to first place)
 
 
 
 I created 3 cases to get position for bone in each frame: (all code i got from actionLib.py from my importers)
 
 1.when bone have only rotation transform:
 
	for n in range(len(actionbone.rotFrameList)): - list of all rotation frames for this bone 
		frame=actionbone.rotFrameList[n] - get frame
		bonematrix=actionbone.rotKeyList[n] - get rotation matrix 4x4 for current frame
		if self.ARMATURESPACE is True: - method
			pbone.poseMatrix=bonematrix 
			pbone.insertKey(skeleton, 1+frame,[Blender.Object.Pose.ROT],True) - insert key only for rotation
			pose.update() - this command i don't understand what is really make, sometimes animation works without this command
		if self.BONESPACE is True: - method
			if pbone.parent:		
				pbone.poseMatrix=bonematrix*pbone.parent.poseMatrix - multiply bone matrix and parent matrix, when bone has parent
			else:
				pbone.poseMatrix=bonematrix
			pbone.insertKey(skeleton, 1+frame,[Blender.Object.Pose.ROT],True)
			pose.update()
 

 2.when bone have only position transform: 
 
	for n in range(len(actionbone.posFrameList)):- list of all position frames for this bone 
		frame=actionbone.posFrameList[n] - get frame
		bonematrix=actionbone.posKeyList[n] - get position matrix 4x4 for current frame
		if self.ARMATURESPACE is True:
			pbone.poseMatrix=bonematrix
			pbone.insertKey(skeleton, 1+frame,[Blender.Object.Pose.LOC],True)
			pose.update()
		if self.BONESPACE is True:
			if pbone.parent:		
				pbone.poseMatrix=bonematrix*pbone.parent.poseMatrix
			else:
				pbone.poseMatrix=bonematrix
			pbone.insertKey(skeleton, 1+frame,[Blender.Object.Pose.LOC],True) - insert key only for position
			pose.update()
			
3.when bone have rotation and position tranform:
	
								
	for n in range(len(actionbone.matrixFrameList)): - list of all position frames for this bone 
		frame=actionbone.matrixFrameList[n] - get frame
		bonematrix=actionbone.matrixKeyList[n]  - get matrix 4x4 (position rotation in one) for current frame
		if self.ARMATURESPACE is True:
			pbone.poseMatrix=skeleton.matrixWorld*bonematrix
			pbone.insertKey(skeleton, 1+frame,[Blender.Object.Pose.ROT,Blender.Object.Pose.LOC],True)
			pose.update()
		if self.BONESPACE is True:
			if pbone.parent:		
				pbone.poseMatrix=bonematrix*pbone.parent.poseMatrix - multiply bone matrix and parent matrix, when bone has parent
			else:
				pbone.poseMatrix=bonematrix
			pbone.insertKey(skeleton, 1+frame,\
				[Blender.Object.Pose.ROT,Blender.Object.Pose.LOC],True)
			pose.update() 			

	
It was all for Blender 249.
i don't know how it make with new API in newest versions of Blender.
If you want i can help you with your animation.		

User avatar
TheDude
mega-veteran
mega-veteran
Posts: 239
Joined: Sun Mar 20, 2011 7:35 pm
Has thanked: 29 times
Been thanked: 59 times
Contact:

Re: Far Cry 3|4

Post by TheDude »

I updated the Maya importer and link (first page, 2/3 of the way down).
There's a new file to place in Maya's Python site-packages folder so make sure to do that.
I fixed an issue with the materials and added support for all 4 uv maps.

And here's an updated list of Pagan Min parts to mix and match as you please.

Code: Select all

BAF1E182F30E09AB.xbg            Hands and shirt
31BA411526EBAF49.xbg            Jacket
E947F48E7E55E0EA.xbg            Head
A78035D76C29FA64.xbg            Hair
D1D687FF151DD3B2.xbg            Pants
D95C21735F0C5BAE.xbg            Shoes
852F71E1617678EB.xbg            Snow_Suit (gloves and shirt)
56A922664B5382DF.xbg            Shirt and shoes (sleaves rolled up)
96FA3A27A323E65A.xbg            Fortress Statue
I still haven't been able to find the diffuse hair textures anywhere.
I even converted some of the DX10 textures trying to find it.
Image
RunaWhite
veteran
Posts: 158
Joined: Sat Jan 07, 2012 2:30 pm
Has thanked: 56 times
Been thanked: 33 times

Re: Far Cry 3|4

Post by RunaWhite »

Thanks for fixing Pagan! About the hair diffuse, I think that maybe it could be ripped directly from the game, though I'm not completely sure about that.
RunaWhite
veteran
Posts: 158
Joined: Sat Jan 07, 2012 2:30 pm
Has thanked: 56 times
Been thanked: 33 times

Re: Far Cry 3|4

Post by RunaWhite »

Hey guys, I'm trying to load the script in Maya, but I keep getting this error:

Code: Select all

# Error: line 1: ImportError: file <maya console> line 8: No module named numpy # 
How can I fix this? Is something missing in my Python folder?
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Far Cry 3|4

Post by howfie »

Yeah, seems like thedude used http://www.numpy.org/ maybe.
RunaWhite
veteran
Posts: 158
Joined: Sat Jan 07, 2012 2:30 pm
Has thanked: 56 times
Been thanked: 33 times

Re: Far Cry 3|4

Post by RunaWhite »

How does it work exactly? Putting the numpy files in the python folder is not enough, so I'm not really sure how its installation works.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Far Cry 3|4

Post by howfie »

what file did you download? this one?

http://sourceforge.net/projects/numpy/files/NumPy/

Download the superpack installer 2.7 in version 1.92 folder. It will require python 2.7 installed on your system.
User avatar
TheDude
mega-veteran
mega-veteran
Posts: 239
Joined: Sun Mar 20, 2011 7:35 pm
Has thanked: 29 times
Been thanked: 59 times
Contact:

Re: Far Cry 3|4

Post by TheDude »

I think I took it out to decrease the file size of the archive. Then I was going to upload it separately and post the link,but I guess I forgot. ٩◔̯◔۶
https://app.box.com/s/jfh8lcrq5vg4odp5yl4x03w4crlyuvlx
RunaWhite
veteran
Posts: 158
Joined: Sat Jan 07, 2012 2:30 pm
Has thanked: 56 times
Been thanked: 33 times

Re: Far Cry 3|4

Post by RunaWhite »

Ah so that was my problem: I apparently had tried to install a wrong version for Numpy. Thank you both, the one posted by TheDude seems to work perfectly now.

The only issue now is that I still can't get Pagan's eyebrows... I got the latest script, so I don't really know why that happens.
User avatar
TheDude
mega-veteran
mega-veteran
Posts: 239
Joined: Sun Mar 20, 2011 7:35 pm
Has thanked: 29 times
Been thanked: 59 times
Contact:

Re: Far Cry 3|4

Post by TheDude »

I don't know how I managed to leave this out of the list, but the model of Min's face with his eyebrows is 9C44E182FDE38402.xbg.

Also grepWin is what I use to find specific models. http://stefanstools.sourceforge.net/grepWin.html
..just throwing that out there
Post Reply