Page 1 of 1
CUnrealMeshFileLoader
Posted: Sat May 19, 2012 9:19 am
by wing64
Unreal PSK mesh and PSA animation loader.
Source and binary:
http://upload.one2car.com/download.aspx ... XZZY5FF5D1
http://file2.uploadfile.biz/i/IVEDMEIMIZXDEW
http://www.4shared.com/rar/8fxu65xj/unreal_loader.html
How to use: (Tested from 01.HelloWorld)
1. Register loader (before call getmesh)
Code: Select all
CPSKMeshFileLoader* psk_loader = new CPSKMeshFileLoader( smgr );
CPSAMeshFileLoader* psa_loader = new CPSAMeshFileLoader( smgr );
smgr->addExternalMeshLoader( psk_loader );
smgr->addExternalMeshLoader( psa_loader );
psk_loader->drop( );
psa_loader->drop( );
2. use animation from psa
Code: Select all
IAnimatedMesh* animation = smgr->getMesh("Female.PSA");
s32 begin, end;
f32 speed;
((SSkinnedMesh*)animation)->getFrameLoop( core::stringc("Push"), begin, end, speed );
((ISkinnedMesh*)mesh)->useAnimationFrom( ((ISkinnedMesh*)animation) );
node->setFrameLoop( begin, end );
node->setAnimationSpeed( speed );
Happy downloading
female model:
http://udn.epicgames.com/Two/UnrealDemoModels.html
Re: CUnrealMeshFileLoader
Posted: Sat May 19, 2012 10:21 am
by smso
I encounter this when I tried to download the file:
"You should Sign Up or Login to download this file"
I don't want to sign up!
Regards
smso
Re: CUnrealMeshFileLoader
Posted: Sat May 19, 2012 10:44 am
by smso
smso wrote:I encounter this when I tried to download the file:
"You should Sign Up or Login to download this file"
I don't want to sign up!
Regards
smso
There is no direct download from the third link only. The first and second ones are OK.
Trying out the loader.
Thanks.
Regards,
smso
Re: CUnrealMeshFileLoader
Posted: Sat May 19, 2012 11:10 am
by CuteAlien
Very nice, works on Linux with 3 minor changes: Pass all the name parameters as const reference instead of reference, so the following will work on gcc as well:
Code: Select all
AnimInfo( const core::stringc& name, s32 begin = 0, s32 end = 0, f32 fps = 30.0f )
void addAnimation( const core::stringc& animationName, s32 begin = 0, s32 end = 0, f32 fps = 30.0f )
bool getFrameLoop( const core::stringc& animationName, s32& begin, s32& end, f32& fps )
Thanks for posting!
Re: CUnrealMeshFileLoader
Posted: Tue May 22, 2012 1:45 am
by christianclavet
Hi! Wow! Does that mean we could take ACTORX and produce our own characters? What is currently supported?
Looking at the code this look really simple to use!!
One warning!
Code: Select all
((ISkinnedMesh*)mesh)->useAnimationFrom( ((ISkinnedMesh*)animation) );
This will affect all the instances!!! So it can be only used on a single character and not multiple (we would need to append all the animations to make this work on multiple characters using the same sets of animation)
Really GREAT work! Saw the demo and I'm greatly impressed!!! Thanks also for the link to the web site, they had modeling and texturing guides using ActorX.
Re: CUnrealMeshFileLoader
Posted: Tue May 22, 2012 9:05 am
by Sky-Fox
Cool, Very nice!!!
Need for work Irrlicht 1.8 :
Code: Select all
virtual IMesh *getMesh ( u32 timeMs, io::IAttributes *animationParameters, u32 levelOfDetail=1.0f )
{
return Mesh->getMesh ( 0,255,-1,-1 ); //FIXME need correct Parameters
};
virtual IMesh *getMesh ( s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1 )
{
return Mesh->getMesh ( frame,detailLevel,startFrameLoop,endFrameLoop );
};

Re: CUnrealMeshFileLoader
Posted: Tue May 22, 2012 10:21 am
by wing64
christianclavet wrote:Hi! Wow! Does that mean we could take ACTORX and produce our own characters? What is currently supported?
Yes, tested w/ actorx 249. And thanks for all comment.
Re: CUnrealMeshFileLoader
Posted: Tue Jun 05, 2012 3:23 pm
by Sky-Fox
Not work on IOS. crash...
Code: Select all
??? 0000000000 0 + 0\
1 Game 0x00186d4c irr::core::array<irr::scene::ISkinnedMesh::SScaleKey, irr::core::irrAllocator<irr::scene::ISkinnedMesh::SScaleKey> >::reallocate(unsigned int) (irrArray.h:67)\
2 Game 0x00189d78 irr::core::array<irr::scene::ISkinnedMesh::SScaleKey, irr::core::irrAllocator<irr::scene::ISkinnedMesh::SScaleKey> >::insert(irr::scene::ISkinnedMesh::SScaleKey const&, unsigned int) (irrArray.h:150)\
3 Game 0x00189f5a irr::core::array<irr::scene::ISkinnedMesh::SScaleKey, irr::core::irrAllocator<irr::scene::ISkinnedMesh::SScaleKey> >::push_back(irr::scene::ISkinnedMesh::SScaleKey const&) (irrArray.h:105)\
4 Game 0x002a7418 irr::scene::CSkinnedMesh::addScaleKey(irr::scene::ISkinnedMesh::SJoint*) (CSkinnedMesh.cpp:1191)\
5 Game 0x00027174 irr::scene::SSkinnedMesh::finalize() (CUnrealMeshFileLoader.h:253)\
6 Game 0x00021898 irr::scene::CPSKMeshFileLoader::createMesh(irr::io::IReadFile*) (CUnrealMeshFileLoader.cpp:586)\
7 Game 0x000731bc irr::scene::CSceneManager::getMesh(irr::core::string<char, irr::core::irrAllocator<char> > const&) (CSceneManager.cpp:399)\
Re: CUnrealMeshFileLoader
Posted: Wed Jun 06, 2012 4:53 am
by wing64
- I'm not sure what is your irrlicht svn version ? (didn't test on ios)
- addScaleKey() dont call in loader but why error occurred

Re: CUnrealMeshFileLoader
Posted: Sat Jun 09, 2012 4:48 pm
by fmx
Nice! Thanks for sharing

Re: CUnrealMeshFileLoader
Posted: Sun Apr 14, 2013 9:03 pm
by HellFlip
Awesome Stuff ! Thanks a lot for this !
The animation system is working fine using Irrlicht 1.7.x, but is broken with Irrlicht 1.8, because of the Irrlicht change "quaternion conversions to and from matrix4 no longer invert rotations."
To fix it using 1.8, do the following change in CUnrealMeshFileLoader.cpp: , in psk_to_irr( psk_t* psk, SSkinnedMesh* AnimatedMesh ):
Change line 396
Code: Select all
core::matrix4 rotationMatrix = joint->Animatedrotation.getMatrix();
To
Code: Select all
core::matrix4 rotationMatrix = joint->Animatedrotation.getMatrix().getTransposed();