-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing MiEx Imports #563
Comments
The USDHook import is limited to 4.1 unfortunately, it acts as a post import action script. |
I think we could also look into extending Prep materials |
Testing MCprep 3.5.3 locally on my machine, it seems Prep Materials can already work with MiEx exports (unintentional obviously, probably related to the graceful fallbacks we have in MCprep), which is a good start EDIT: vegetation doesn't get proper color multiplication in the generated materials |
Tagging @TheDuckCow |
Keep in mind that MiEx has material template, so you don't have to use MaterialX materials or UsdPreviewSurface materials. You could for example create some material templates where you essentially encode native Blender material networks as USD data 1-to-1. Then in the USDHook, you would have access to the USD data from which you can decode the Blender material networks. The main part would be figuring out a mapping from the material in USD to the material in Blender, so that you actually fix the right material. You could then also say that all node types have a prefix like |
Using either MaterialX or UsdPreviewSurface is fine since what MCprep works with is the material names. Beside USDHook stucked in 4.1 in Blender 3.5 the exposed USD Python binding is good enough if you need to access the USD stage file and go for any shader attributes reference easily. For wanting support old versions of Blender early than that, might have to use external usd python package. |
In trying to get Unreal Engine to fully load in MiEx exports with materials, I've ended up extending the material templating system to also be able to write out the materials to alternative material definition files. When specifying the types of nodes, you can put in a namespace to tell MiEx what file type it should write that node out into. It can also do this while still writing out all of the other shading nodes just like normal. So, if it would make it easier for MCprep, I could add in to MiEx that it can write out the material information to some custom file format, maybe like a json file. It could specify the name of the material, the texture, whether it has biome colours on it, keyframes for animated textures, a list of utility textures, whether it has transparency, etc. It could also just write out full material networks out into a json file which could then be read in by MCprep in any version of Blender and used to create the material network from that. We could then just specify the native Blender shading nodes in the material templates 1-to-1. While MCprep has its own material templating system, users of MiEx might assume that MiEx's material templating system gets used. Just something to keep in mind. In any case, there are quite a few possibilities, and if I can add anything to MiEx to help with this, then please don't hesitate to submit an issue post on the MiEx repo. |
Check against existing requests
Describe the context
MiEx (https://github.com/BramStoutProductions/MiEx) is a new exporter that has been used for Minecraft Live's trailers, and was recently open sourced under the BSD 3-Clause license. Unlike previous exporters, it doesn't export OBJ, but instead USD (Mineways does too, but the default is OBJ), and takes advantage of MaterialX. Due to Blender's lack of support at the moment with MaterialX,
UsdPreviewSurface
has to be used instead, resulting in a lot of manual work needed to get MiEx exports to look good. Of course, this will likely be solved at some point by the Blender Foundation, but USD and MaterialX doesn't seem to be a priority for them.How do you imagine your feature works?
MCprep has Prep Materials which fixes OBJ imports, so why not a version of Prep Materials that fixes up MiEx exports? This would certainly fill in the gap that currently exists. As @zNightlord has mentioned on the MiEx repo (BramStoutProductions/MiEx#6 (reply in thread)), Blender does have hooks for USD to extend imports.
The only downside is trying to determine what USD imports are MiEx USDs. We don't want this hook to start going haywire on non-related USDs after all.
What existing workaround (or closest thing to a workaround) do you have today (within Blender, MCprep, or any software)? If there is no workaround, explain why you feel this way.
Beyond manual work, no existing workaround exists, due to limitations in Blender's existing feature set.
The text was updated successfully, but these errors were encountered: