Blender Add-on: PapyNR

yeah modeling of dmg meshes can be done in three different ways, surely more
for any resulting mesh, the key is to respect the engine's dmg conventions
prob. best to respect them from very beginning ... but that would hinder modeling workflow very much I guess ..

anyway I'll see what blender has to offer for an agreeable workflow when I check out PSG's/engine's dmg convention
(... export and re-import of same would seem unnecessary to me)
 
ok I am afraid to admit how much time I spent hacking away at this but I found a faster and less user error prone method. Despite my best efforts and everything I know about blender it kept making the pas compiler give vert count errors for more complex meshes.

Essentially the PAS file when it comes to damage morphs (when not using animation frames) just needs to know the difference in the VERTEX_LIST every other block in the data structure needs to be 100% the same as the undamaged piece. It appears blender is too smart as it tries to auto-clean a mesh: The Normals: It changes the shading math because the angle changed. The Index Order: Sometimes, if a face is moved or "folded," Blender's exporter re-prioritizes which vertex is listed first. The UV splits: If a vertex is pulled too far, it can "un-stitch" from its neighbor in the internal buffer.

So what is the next option? Simply 'sanitize' the exported PAS file post-process to REPLACE every damaged mesh with the undamaged piece's data except for the VERTEX_LIST

Keep the same:
VERTEX_LIST

Delete and replace with undamaged mesh's data everything else until the data structure block ends: (literal copy/paste method)
FACE_LIST
NORMAL_LIST
MATERIAL_REF
TEXTURE_FACE

of course you can manually go into a pas and copy/replace but that is tedious so I made a script to auto-find any pas files in the folder I run it to find and replace these data blocks for me:
1771482111460.png

what would take a ton of work every time I have to make a change in blender now is a mere second to fix. I just have to make sure my damaged and undamaged meshes in blender have matching vertex order as that is now the only thing the pas will retain.

I don't know if there is a way with the addon to make it post process chosen meshes to sanitize referencing another but this is the next best thing working for me right now (unless someone blender savvy knows how to make blender match data with another mesh 100% while the vert positions are different).

No more exporting or importing OBJ's I just have to ensure the original meshes are consistent for vertex order
 
With the script it thankfully alleviates it a lot more though, I don't have to import/export anything, my post on the previous page can pretty much be disregarded minus the trial and error breakdown lol, the copy/paste method refereeing the undamaged pieces directly pasting its data to the damage pieces (leaving vertex list alone) is a lot easier.

With this current mod I'm able to ram into wall head first and see the front end blow off or do a barrel roll and the top flattens and take damage as expected with no weird geometry issues.
 
Generated L3 Lods for one of the makes today, this went MUCH faster knowing I just have to replace all the damaged L3 parts with their respective L3 data using the script I have, zero compile errors and damage in game all translated as expected.

I went from spending probably 3 days on L1 Lods (stuck on compile error lol) to a hour or less on the next Lod level.

I don't forsee any issues as I generate the rest of the damage for the other makes and Lods levels so my next check in with the plugin will probably be when I move to the cockpit which has other different elements like the gauges and stuff.that animates.
 
re car damage and I'm inspecting PSG and 3DO
COTV3.psg in Nisbet_3do_Tutorial.7z as linked from here
(pls advise on better example if available)​
How do the "bitfield" parameters work? how to arrive at 8 and the 0,8,16,24 to the right? do we know how the bitfields interact with the BBOX?
sandbox docs are informative but not enlightening
***
(A)---relevant excerpt from COTV3.psg

(B)---visualization; yellow is "B_L1_PUD_body_546909" in 3DO

***
---(Sandbox\docs\make3do.doc)---REGION_MORPH---Constructs a REGION MORPH node. The two meshes must have the same number of vertices and faces, and the vertices and faces must be in the same order for it to work correctly. [In 3DS Max and to ensure that vertices and faces remain in same order, create the two meshes by modeling an animated mesh, then use two frames of the animation for this construct.] Each region can be controlled by its own state variable, or regions can be setup to share a variable. Optionally (and optimally), the state variable can be broken into bit fields (up to 32 bits total) where each field controls a region of the mesh. In each region, the bbox defines which vertices are considered part of the region (vertices can be included in more than one region and weights will be calculated automatically).
Code:
sceneIdentifier: REGION_MORPH meshIdentifier DESTINATION meshIdentifier
        REGIONS (bboxIdentifier stateVarName [numBits firstBit],
                 bboxIdentifier stateVarName [numBits firstBit], ... )
 
All I know is the numbers represent the region the damage will occur according to the bounding boxes you labeled on the mod. If your label associated to the BBOX is incorrect then for example say you hit the right side of the car into a wall but the left side takes damage instead you assigned it incorrect.

For example I make a BBOX for my hood of my car and then I assigned that cube as the hood_damage 8 0 region. If I were to instead assign it to chassis 8,24 if I slam the car head first the hood won't morph. Or if I made a BBOX on the roof and associated it to be hood_damage 8 0 then when I slam head first even if the roof was not touched it caves in.

Also, to my understanding the number possibly plays a role in the 'resolution' of damage done. For example how hard or soft you hit an obstacle if the morph will shape slowly or instantly.
 
Last edited:
re REGION_MORPH---make3do.exe splits the source mesh per boundBoxes specified, writes these regions into named <_damage> containers (the destination) and appends to each the list of vert_indices to reference/match all this stuff
⠀⠀(it does not look the bitfields would affect anything in this geometry split)

judging from inspecting papy cup .3DO:
(A) --- it looks like the bitfields are some sort of subregion, enabling the sim's dmg model to differentiate the affected side of <chassis_damage> and <corners_damage>
Code:
---  dmg subregions (bitfield mapping)  ---  papy cup .3DO
        chassis       corners
 0      ---n/a        frnt left
 8      left          frnt right
16      right         rear left
24      roof          rear right
⠀⠀conclusion is to consistently match the second bitfield number to the used boundBoxes (and the latter's exact extents ... which we are free to set)
***
(B) --- papy re-used the rearend setup <rend_damage 8 0> for 3 different boundBoxes
⠀⠀yellow=entire rear⠀⠀⠀⠀cyan=rear center⠀⠀⠀⠀⠀magenta=rear wing
⠀⠀
 
Ultimate stress testing the plugin as my current mod in development now has lods for undamaged version and full lods for all 4 makes with damage. the output of meshes has grown exponentially in the single scene:

Screenshot_20260221_171501.png

its so far faster than exporting from the old 3ds max 8 a large PAS scene, only a small pause until it completes.
 
no yikes, perfectly normal for a feature complete mod. Its all the separate damage pieces and lod levels that really makes the count go up. Not all those meshes would loaded at once but a mod has tons and and tons of parts. Its good the exporter is not having any issue with large quantities needing to be exported into a single pas file.
 
Opening post updated for v.0.0.3
https://www.mediafire.com/file/pq2ya8djfzczlq1/260302_papynr2003.zip/file
***
-- PAS export⠀⠀⠀⠀/ adds scratch PSG for meshes within PAS; see Summary of PAS output
-- PAS export⠀⠀⠀⠀/ supports Sharp Edges: mesh is split at authored sharp edges
-- ui, PAS export⠀⠀/ adds Collections and custom assignment to selection of objects
-- 3DO and PAS⠀⠀/ improves handling of normals
-- 3DO import⠀⠀⠀ / supports <RegionMorphVertexListDescriptor> (damage mesh)
 
Opening post updated for v.0.0.3
https://www.mediafire.com/file/pq2ya8djfzczlq1/260302_papynr2003.zip/file
***
-- PAS export⠀⠀⠀⠀/ adds scratch PSG for meshes within PAS; see Summary of PAS output
-- PAS export⠀⠀⠀⠀/ supports Sharp Edges: mesh is split at authored sharp edges
-- ui, PAS export⠀⠀/ adds Collections and custom assignment to selection of objects
-- 3DO and PAS⠀⠀/ improves handling of normals
-- 3DO import⠀⠀⠀ / supports <RegionMorphVertexListDescriptor> (damage mesh)
1772948698138.png
Do you know what I should be looking for when loading into the file? Sorry for the confusion
 
You need to go to Preferences > addons and install the zip there to enable it.

The top toolbar you will see a new option to the right of the select/add/object menus:
1772960464554.png
 
friend of mine helped me get a model of a project im working on in
first order of business will be optimizing and prepping xfinity models for a mod (maybe)
 

Attachments

  • image.png
    image.png
    2.7 MB · Views: 21
Back
Top