Page 3 of 4

Re: Far Cry 3|4

Posted: Wed Dec 24, 2014 11:13 pm
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.

Re: Far Cry 3|4

Posted: Sat Feb 07, 2015 3:29 pm
by RunaWhite
I am curious: is the issue for Pagan Min still there, or he can be imported correctly now?

Re: Far Cry 3|4

Posted: Mon Feb 09, 2015 4:40 am
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!)

Re: Far Cry 3|4

Posted: Mon Feb 09, 2015 7:10 am
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.

Re: Far Cry 3|4

Posted: Mon Feb 09, 2015 4:41 pm
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.

Re: Far Cry 3|4

Posted: Mon Feb 09, 2015 6:09 pm
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.		


Re: Far Cry 3|4

Posted: Thu Feb 12, 2015 2:50 am
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

Re: Far Cry 3|4

Posted: Thu Feb 12, 2015 10:36 pm
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.

Re: Far Cry 3|4

Posted: Tue Mar 24, 2015 11:32 am
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?

Re: Far Cry 3|4

Posted: Tue Mar 24, 2015 8:01 pm
by howfie
Yeah, seems like thedude used http://www.numpy.org/ maybe.

Re: Far Cry 3|4

Posted: Thu Mar 26, 2015 11:53 pm
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.

Re: Far Cry 3|4

Posted: Fri Mar 27, 2015 12:11 am
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.

Re: Far Cry 3|4

Posted: Fri Mar 27, 2015 1:01 am
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

Re: Far Cry 3|4

Posted: Fri Mar 27, 2015 9:50 am
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.

Re: Far Cry 3|4

Posted: Sun Mar 29, 2015 12:19 am
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