Game Development Community

Help with export Physx from Max

by PGames · in Artist Corner · 01/26/2010 (10:42 pm) · 24 replies

I just started using Torque and am trying to export physics objects from Max. Looking at the documentation from Torque, it shows several images with green dummy like objects called base 00, start 00 and such, what are these? Right now, I have the original object Box01, a bounding box called bounds, and the collision box called Box01_pxactor. When I export though, in the xml, the actor 0's always left blank. And I get an error that says
PhysX Error:
f:\p4physx\experimental\PhysX_2.8.1_GPU\novodex\SDKs\Physics\src\NpScene.cpp(894) : Supplied NxActorDesc is not valid. createActor returns NULL.

Please help.
Page «Previous 1 2
#1
01/27/2010 (1:10 am)
Yeah this is kindof a part of the wild world of T3D's adolescent development stage IMO.

The pre-collada format and also, what collada is compiled into by the engine, is the .DTS format. There is a 'needed' hierarchy for DTS ..however, working with collada, those nodes are added by the engine-importer *yet* for PhysX objects, you need to add this hierarchy..(you can add the nodes to any other dae model file if you so choose).

Here is information for 3dsmax and dts hierarchy:
docs.torquepowered.com/artist/official/3D%20Studio%20Max/Reference.html


Let me know how you do with PhysX object exporting.
#2
01/27/2010 (2:59 am)
I tried the DTS setup, but I'm still getting problems of getting physics actually working ingame. Here's my max file, can anyone tell me what I'm missing in the setup? Thanks.

http://biz75.inmotionhosting.com/~pathea5/boxtest.max
#3
01/27/2010 (11:12 am)
All those dummy nodes you are seeing are part of the hierarchy for the visible mesh. They are not needed to export the PhysX counterpart. For the sake of troubleshooting just go ahead and get rid of the hierarchy for the visible mesh before exporting the PhysX XML. This includes the bounds box, the base node, start node, detail markers, and visible meshes. It's normally not technically necessary to delete them, as the PhysX plugin should only export what meshes (and joints) have become physical, but it makes things simpler for now. So, in your case, your file before export should only include Box01_pxactor. Add it as a physical actor and export your XML.

But, as eb stated, that hierarchy of dummy nodes is a necessary part of exporting a visible mesh. So eventually, your Box01 mesh (the non-PhysX part of the equation here) will need to be set up this way and exported to .dts or .dae (preferably .dae).
#4
02/01/2010 (4:26 pm)
Whenever I export an XML file using the 3DS Max physx plugin, there is an extra actor in the file that has no name. The actor is Actor_0, and the name tag is empty. Since the actor is not filled out, Torque cannot use the XML file. If I delete Actor_0 everything works correctly because it is able to continue on to parse Actor_1, Actor_2, etc. which are the actual pxactors that I created. However, I don't want to have to manually edit the XML file every time I create a new object.

Does anyone know how to prevent the physx exporter from creating the empty Actor_0?
#5
02/01/2010 (9:55 pm)
On top of that, are we suppose to make the pxactor collision box not render in game through code or somewhere in Max? I was assuming that once the object is called XXXXX_pxactor, it automatically doesn't render ingame, but that doesn't seem to be the case.
#6
02/01/2010 (11:28 pm)
Quote:On top of that, are we suppose to make the pxactor collision box not render in game through code or somewhere in Max? I was assuming that once the object is called XXXXX_pxactor, it automatically doesn't render ingame, but that doesn't seem to be the case.
Nope. Hiding the PhysX actors in code isn't necessary. If you're seeing a collision volume, then it is likely that you either scaled that volume with the scale tool or by moving vertices (which you should never do...only dial in the size), or you left the PhysX actors in your scene when you exported the visible mesh.

And by the way, simply calling the actor XXXXX_pxactor doesn't make it physical. You also need to add it as an actor using the PhysX plugin.
#7
02/01/2010 (11:32 pm)
Oh, and this is the first I've heard of this Actor_0 showing up. I'll forward this thread to James Ford, who worked a lot on the PhysX implimentation, ASAP.
#8
02/01/2010 (11:47 pm)
Ah, I think the actor 0 problem is now solved. I just need to export the base mesh as export selected instead of exporting everything including the physx actors. But whenever I try to add the physx contraint, actor 0 shows up again. Plus the contraint doesn't work.
#9
02/02/2010 (9:57 am)
Quote:I just need to export the base mesh as export selected instead of exporting everything including the physx actors.
Obviously, yes... don't allow your PhysX actors to be exported with your visible mesh.
#10
02/02/2010 (10:07 am)
So I havent had a chance to look at your max file yet, but this kinda falls in line with my problems. I have the pxactor as physical (do I also need the visible mesh physical?) and I have the old dts hierarchy in place. Where the problem lies is that once exported using the collada export inside the physx plugin (are we supposed to use this?) I get nothing on screen, collada file seems almost like its completely empty. Any ideas?
This is for any physical object whether it be cloth, rigid, etc.
Also what is the proxy mesh?

I've been struggling on this as I followed the documentation and it doesnt seem to be working for me, I will post a screen of my hierarchy when I get a chance.
#11
02/02/2010 (12:45 pm)
OK, I can't be more clear about this. When exporting your PhysX XML, go ahead and delete your visible mesh hierarchy and bounds box beforehand. When exporting the visible mesh hierarchy to Collada, go ahead and delete your PhysX elements beforehand. This avoids any accidental export of one set of elements into the wrong file. This shouldn't be that difficult... put them each in a different layer if you need to, so it's easier to select and delete each set entirely.
Quote:I have the pxactor as physical (do I also need the visible mesh physical?)
Good question, Brian. No, you don't want to make any of the visible mesh physical. The visible mesh is just the visible counterpart to the physical actors. Their positions in the game just follow the position of the physical counterpart.
Quote:Where the problem lies is that once exported using the collada export inside the physx plugin (are we supposed to use this?)
I would recommend you export the Collada file from Max using File>Export (or File>Export Selected, as Zifei Wu suggests), not the PhysX plugin. And as a side note, Autodesk's built-in Collada exporter isn't the greatest (and won't export the User Properties data that you need to work with PhysX joints), and I would highly recommend that you download the free OpenCOLLADA exporter and use that. So to export your physical mesh, you would choose File>Export>OpenCOLLADA(DAE)

#12
02/02/2010 (6:32 pm)
Sweet thanks, will try this and let you know my results.
#13
02/02/2010 (8:25 pm)
Ok, so that worked except can you help me understand what is going on with the actual physx mesh.
dae model imports at set size (grid at 1.0) but the physx collision (*_pxactor) is huge like its not holding to the size of the object.
Any ideas?
do I need to put a property on the physx object?
#14
02/03/2010 (1:48 am)
www.prosimianproductions.com/ark/gg/RenderProblem.jpgJust curious if you guys have seen this before?
Got the building to finally work and it seemed to be a problem with torque importing the collada at a scale of 0.25 of its original.
This is what I got after I fixed it.
Now I got to get the textures on it and some weight so it doesn't knock down when I run in to it.
#15
02/03/2010 (7:42 pm)
I have been slowly figuring this out after several days, there was alot of this not covered in the documentation (specifically splitting the files) so I believe I will make a newbie tutorial for those of us who didn't quite know where to start with the physx stuff.
#16
02/03/2010 (7:49 pm)
EDIT: deleting double posting.
#17
02/03/2010 (9:44 pm)
Adam,
The docs are not the only issue here, it's also the collada exporters and/or the importing of different collada exports that are causing "chewing" issues.(chewing: random data is breaking at random)

I have been exporting DTS instead of DAE and that has shown to have significantly reduced the amount of problems. DAE imports of multiple mesh items worked less than 10% of the time and I have had varying success rates for each of the three collada exporters I have used. My finding is that nothing has been predictable with collada exporting/importing for phyX files.

I realize this post is 'jumbly'..there's just too much info to relay in a forum post.

DTS and physx xml has been ideal for me.
#18
02/03/2010 (11:01 pm)
Hmm I will keep this in mind and try it out as having to setup object as dts already would be easier to export them as such. I might add both methods as I have been rather successful in making objects that "shatter" with dae imports, I just export the dae after the engine has loaded and reimport the dae file alone to rescale it properly.
#19
02/09/2010 (2:27 am)
Curious question, how many destroyable groups am I limited to?
I know I have the initial object, then I have the destroyable group, is there a way to say do destroyable group 1 separates to group 2 that can also separate to group 3, to fake a further destroy ability.
#20
02/09/2010 (8:54 am)
@all:

what's your success rate on exporting fully functional physx objects ? (breakables/joints)
Page «Previous 1 2