Author Topic: Corona Physical to Autodesk Physical Material Converter  (Read 6237 times)

2023-09-13, 14:32:35
Reply #30

Ink Visual

  • Active Users
  • **
  • Posts: 169
    • View Profile
Thanks James!

To be fair, for our purposes using base layer instead and ignoring everything that happens in CoronaMix is good enough (same with any other non-supported maps).

Whenever we export our 3ds Max model outside to other software it's usually for architects to do some further design adjustments. They don't need to see the exact shader representation in whatever software they import model to, it's just to make it easier for them to read different materiality, not having to go through the hassle of differientiating glass from walls etc.

So as long as whatever can be converted is processed, and whatever is not yet supported receives a warning (ie. that it has been removed from the shader node stack) - we are all good!

This might obviously not be perfect for some other use cases, but for us it's more important that the conversion is actually succesfull rather than 100% acurate.

2023-09-13, 15:00:36
Reply #31

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Ok cool thanks for the clarification.

Yeah I found a better way of handling bitmaps now so I can extract them from whatever nodes they are in without raising problems in future. So ill update this by the end of the week so you shouldn't have that problem. Ill keep you posted.

Regarding other cases yeah ill have a think about it since I think most people are in the same boat as you, they just want a way to export from 3dsmax from corona so generally more feedback is better from users since the majority vote would be the beneficial way to go - that being mainly for export I guess at this point. Theres always ways to handle things for different users as well but until then this script is just going the way of the request lol.

2023-09-13, 15:16:53
Reply #32

Ink Visual

  • Active Users
  • **
  • Posts: 169
    • View Profile
Can't wait to see another update.
Thanks a lot for your hard work on this!

2023-09-14, 09:39:38
Reply #33

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Hey Ink Visual,

No worries. Just an update on this not sure where you are getting that issue since for me it works even with a CoronaMix. It looks like its having trouble finding your bitmap from what I can gather from this error, hard to tell though.

I have created a separate version of the script for your situation. This just finds bitmaps and removes all nodes in between. The reason I did this is because @romullus previously requested to keep all nodes such as composite/falloff etc. So if you drag this version into your viewport it will override the previous one since the macro should remain the same but update the code. The icon should remain etc.

This way anyone who needs to keep the hierarchy can use CoronaToPhysical_v1.8. Anyone who wants to strip the hierarchy can use CoronaToPhysicalBitmapsOnly_v1.0.

Before:
1" border="0

After:
2" border="0

Script attached to this post.

2023-09-14, 12:22:25
Reply #34

Ink Visual

  • Active Users
  • **
  • Posts: 169
    • View Profile
Hi James!
That's great, thanks a lot, I will test out very soon.
Will also have another look at our scene where we encountered Corona Mix issue, perhpas indeed the problem lays in original bitmap used rather than Mix node.
Cheers!

2023-09-20, 20:40:23
Reply #35

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8854
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Hi James,

I had simple Corona physical material where Corona normal was plugged into both bump and clearcoat bump slots, after conversion i got Autodesk physical material where normal bump node was plugged into bump slot and Corona normal node was plugged into coating bump slot (see attachment). Could you fix this please?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-09-21, 10:16:33
Reply #36

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Script attached to this post

Version 1.9 Features:
- Updated CoronaNormal -> Normal node to work scene wide instead of locally. Should instance throughout uses eg. Bump, Coat_Bump etc.

All good. Maybe if you could move comments section after "macroscript" line, so that 3ds Max won't be stripping it away and the user would have ability to quickly check which version he's using, that would be nice.

Hey romullus, not sure what you mean by stripping away, when you right click on the button and select Edit Macro Script can you not see the section at the top? Or are you doing this a different way?
macro" border="0
« Last Edit: 2023-09-21, 11:03:06 by James Vella »

2023-09-21, 10:49:08
Reply #37

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8854
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Yes, i'm doing it like you described, but i can't see the section that is marked in your screenshot, only what's below it. Even if i go to the folder where macroscript is located and open it in notepad, there is no that text. Is this a new lines that have been added to 1.9 version? I think i'm currently using 1.8
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-09-21, 11:02:48
Reply #38

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Ok I see what you mean, you can always open the attached .ms file and you will see it at the top. No these are not new, its always been like that. Ill just put it below the macro anyway so if you redownload 1.9 now it should be there for you.


2023-09-21, 11:05:38
Reply #39

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8854
  • Let's move this topic, shall we?
    • View Profile
    • My Models
That's strange, if i drop the script on the viewport, Max reads the script from the folder i dropped it, but as soon as i restart the Max, it reads the script from usermacros folder, where the script file has no versioning in its filename and its content is modified by stripping away the portion that is marked in your screenshot. I think that what i was wanted to say when i asked if it's possible to move top comment section below "macroscript" line. Maybe i'm doing something wrong and there's more correct way to install macroscripts, other than simply drag and dropping them to the viewport?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-09-21, 11:07:24
Reply #40

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8854
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Ok I see what you mean, you can always open the attached .ms file and you will see it at the top. No these are not new, its always been like that. Ill just put it below the macro anyway so if you redownload 1.9 now it should be there for you.

Ah nice, thank you for this little improvement! :]
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-09-21, 11:16:02
Reply #41

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Ah nice, thank you for this little improvement! :]

No worries.

That's strange, if i drop the script on the viewport, Max reads the script from the folder i dropped it, but as soon as i restart the Max, it reads the script from usermacros folder,

Yeah thats the way macros work, for example .ms scripts are just run once and are not stored, but if you put a macro in the .ms file it puts it into your macroscripts dir so it can be loaded at start time. FYI if you are interested - lots of macros can slow max down at startup or even corrupt the ENU if something breaks. Just something to keep in mind if that folder gets mind boggling big and you dont use half of those scripts anymore for example.

where the script file has no versioning in its filename and its content is modified by stripping away the portion that is marked in your screenshot.

Yeah I wasnt aware of that being stripped once it sets it as a macro, but now it makes sense thanks for the heads up. I'll just do it this way from here on.



2023-09-21, 13:46:05
Reply #42

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
By the way, I notice randomly when running this script in 2024 it creates a second normal node, its not connected but it has some weird phantom connection so when you re-wire it somewhere it adds connections to both. Kind of hard to explain but I cant replicate this in 2021 so I'm guessing its a slate editor bug in 2024. You can safely delete that second node otherwise.

Strangely I found that if I Hold the scene and then run the script and that extra node appears, I Fetch the scene, run the script again and then it doesnt do it. Which is why Im thinking its a random bug.

2023-09-21, 14:23:17
Reply #43

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8854
  • Let's move this topic, shall we?
    • View Profile
    • My Models
It happens here too, but in my case it leaves unconnected Corona normal node. I thought it's by design. Anyway, that doesn't bother me too much.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-09-21, 15:05:13
Reply #44

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Yeah but watch what happens if you rewire that node lol, does some funky stuff.

Since it doesnt happen in 3dsmax2021 Im thinking it has to be a bug in 3dsmax2024 slate editor - not refreshing properly. Anyway if its still an issue after the next autodesk update ill take a look if it becomes a problem.

By design it replaces that node entirely. Like it does in 3dsmax 2021. That screws with my OCD :D

Before:
before" border="0

After:
after" border="0
« Last Edit: 2023-09-21, 15:17:08 by James Vella »