Skip to content
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

Shaders won't get stored in file when exporting/importing #63

Open
mvort opened this issue Feb 19, 2023 · 2 comments
Open

Shaders won't get stored in file when exporting/importing #63

mvort opened this issue Feb 19, 2023 · 2 comments

Comments

@mvort
Copy link

mvort commented Feb 19, 2023

Describe the bug
I am trying to edit the course file of a mario kart wii track, I'll export as dae and reimport without having made any chances. shaders and materials are lost in the process
if i want to reimport the materials all shader information is gone and needs to be manually set to the original value

To Reproduce
Steps to reproduce the behavior:

  1. Open course_model.brres file of any mario kart wii track (e.g. https://wiki.tockdom.com/wiki/Area_64)
  2. Export material course_model.brres > 3DModels(NW4R) > course > Materials > dash_panel as dash_panel.mdl0mat
  3. Export course.mdl0 as course.dae
  4. replace course.mdl0 with exported course.dae
  5. import asset > material > dash_panel.mdl0mat
  6. shader information is gone

Expected behavior
original shader information should be restored

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 8
  • Version v0.39 Hotfix 1

Additional context
Would be great to have an option to export all materials shaders beforhand and import/restore them all at once. otherwise we will have to manually compare and edit those values

I have tried using this plugin but it doesn't seem to work properly anymore:
https://github.com/zach-zajack/matshader-replace

  1. BrawlCrate will crash if there are errors in the brres file (e.g. https://wiki.tockdom.com/wiki/Grassy_Plains)
  2. materials and shaders will not be added/replaced at allhttps://wiki.tockdom.com/wiki/Grassy_Plains

is the api still correct and could be used as a temporary workaround?
image

@Gabriela-Orzechowska
Copy link
Contributor

Considering the structure of MDL0 and how shaders are linked to materials using an array this is not a bug.
It's not really possible to store that information in material file efficiently.

@mvort
Copy link
Author

mvort commented Feb 20, 2023

If that is true, then one could possibly write an external plugin (or even implement a new feature) comparing the original mdl0 to the new mdl0 and restore all values in material/shader files. That's what I had to do manually.. if something could be done by an algorithm more efficiently, it should be :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants