General-101 / Halo-Asset-Blender-Development-Toolset

CE/H2/H3/ODST JMS/JMA/ASS exporter for Blender
https://c20.reclaimers.net/
MIT License
121 stars 22 forks source link

Feature: Exclude non-render geometry from export #58

Closed jadshep closed 2 years ago

jadshep commented 2 years ago

Motivation:

As I've been learning to map for Halo I've fallen into a workflow where I have many objects that shouldn't be included in the exported file, but it's tedious to make sure everything has the proper viewport visibility set every time I export. I personally find it much easier to set output via the render visibility and not worry about what's presently visible in the viewport at time of export.

What it do:

Adds an option to the ASS exporter to include/exclude objects that are hidden from render alongside the same option for hidden from viewport.

With this comes an update to how objects and collections are gathered during the export. It now recursively crawls the collection structure starting from the active view layer's.

Previously, as far as I could tell, the exclusion of objects that are nested multiple collections below a hidden collection was flaky. As far as I can tell from my limited testing this new method is far more reliable.

Considerations:

I have very limited previous experience with python/bpy, am completely new to this codebase, and am still learning to map Halo, so it's very likely I overlooked something.

This is only implemented in the ASS exporter, but I would like to eventually do the same with all exporters.

PS:

If this pull goes well I want to touch up the way objects and modifiers are unhidden in the export process. I'm often left with my workspace all messy after an export when objects are unhidden and modifiers enabled and not reverted after.

This would involve storing these states before the export and just reapplying them afterwards. This would also include a similar option to this pull, where only modifiers that are enabled for render will be applied on export.

KonradBartlett commented 2 years ago

i want this please ty

jadshep commented 2 years ago

Will likely have JMS ready to go tomorrow. I have zero experience with Halo's animation pipeline, so I can't make any promises, but will do what I can to get JMA working.

jadshep commented 2 years ago

So I had to rework a bit more than I expected to get everything working properly, but I think it should be an easy path forward.

I also found that JMI exporting broke around a month ago. I should have that fixed in this pull when complete.

jadshep commented 2 years ago

@General-101 I think this pull is now ready to go for all file types, though I still want to do a bit more testing. I'll try to get that finished tomorrow if I have time.

General-101 commented 2 years ago

Sounds good. Let me know when you've checked that all out. Once it's ready I'll check it a bit on my end and merge if it all looks good.

jadshep commented 2 years ago

It's good to go as far as I can tell! Though I would suggest extra attention around JMA as that's the area I have the least experience.

General-101 commented 2 years ago

Is there a reason you're ignoring hide_set when excluding objects from export? The hide_set property doesn't seem to exclude objects anymore. Everything else seems fine otherwise.

jadshep commented 2 years ago

Looks like that section got lost somewhere along the line, should be good now.

General-101 commented 2 years ago

Looks good now. Merging