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

2023-07-15, 09:06:15

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
By user request I am releasing this script for free. Script attached to this post.

Notes:
- You can copy/paste, change, learn from it or do whatever to suit your own workflow if you know maxscript.
- Works on scene materials (any object with a Corona Physical Material applied). Not on selected objects so be aware this will convert everything in that scene.
- Currently works with Standard Bitmap, not CoronaBitmap. For example will keep the bitmap as CoronaBitmap instead of converting it to Standard, will update in next verison.
- Be aware this is version 01 so there is probably issues to iron out, your feedback is required to make this better. FYI I don't plan on developing this long term, maybe or maybe not, no promises but for the time being happy to work on it in my spare time.


Install:
- Drag the script into your 3dsmax viewport.
- Customize > Customize User Interface > Toolbars > Category: Vella > Automate CoronaToPhysical

Version 1.0 Features:
- Base Color
- Roughness or Glossiness
- Anisotropy Amount / Rotation
- IOR
- Metal
- Refraction (could be incorrect, still trying to work out how this works in Autodesk Physical)
- Thin Shell
- Opacity
- Emission / Self-Illumination
- Normal / Bump (numeric values kept default 0.3, let me know if this is an issue)
- Displacement
- Clearcoat Amount / Roughness / Bump
- Numerical values such as Base Color Amount, Roughness Amount, IOR value etc.
- Color swatches such as Base Color, Self-Illumination etc.

Exporting to FBX:
- FYI, export does not support the use of the 'Additional Bump' parameter. I have kept it for now since it will work directly in 3dsmax but could create an issue for exporting to FBX. Your feedback is required as I don't know the real-world implications.
- Currently all nodes are kept during the conversion so this also poses a problem for exporting to FBX. For example if you have your Base Color in a Falloff node then the Falloff is kept on conversion. Again real-world examples can help. I might even put a pop up if you prefer such as "Are you exporting to FBX Yes/No?". This way you can either keep all the nodes or just keep the bitmaps.

Corona Physical Material:
corona" border="0

Autodesk Physical Material:
phys" border="0
« Last Edit: 2023-07-15, 10:02:59 by James Vella »

2023-07-15, 10:57:45
Reply #1

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Hi James, thank you for the effort! I would love to try your script, since converting from Corona to Autodesk physical material is what i do quite often, but the problem is, that i almost completely adopted Corona bitmap by now and it looks that your script is not supporting it. If at any point you will bring support for Corona bitmap, i will be first in line to test the script and provide you with the feedback. And again, thank you for doing what, honestly speaking, should have been done by Corona team long time ago.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-15, 12:18:38
Reply #2

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile

2023-07-15, 13:30:04
Reply #3

James Vella

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

Hmm it works but not in the way I wanted it to. I wanted it to be recursive, ill work it out later but for now you can use the updated version which will do the job (Corona Bitmap to Bitmap).

Notes:
- Just a test for now since it should copy all the bitmap settings as well like coordinate offsets, real-world, blur etc. That will be the next small update.

Version 1.1 Features:
- Corona Bitmap to Standard Bitmap conversion

Corona Physical Material:
cb-corona" border="0

Autodesk Physical Material:
cb-phys" border="0
« Last Edit: 2023-07-15, 13:51:48 by James Vella »

2023-07-15, 14:45:27
Reply #4

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Nice!! I will let you know how it worked, once i have time to test it. Thank you very much! :]
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-16, 19:53:05
Reply #5

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Tried both scripts briefly and i love them! I found few small issues with CP->AP script.

1 - anisotropy mapping is completely wrong. Judging from the visual preview the tool sets anisotropy to some off the charts value that's not even possible to set with the spinner. And that happens even if Corona material has zero anisotropy.
2 - bump strength gets ignored, it always converted to Autodesk's stupid default 0,3 which is really annoying. On the other hand i love when that happens with your other script, because in that case script inadvertently fixes stupid incoming bump to Corona's proper default, which is not good when you're working with old fashioned bump maps and arbitrary strength values, but great when you're dealing with normal maps.
3 - cosmetic issue - when Corona physical is populated with Corona bitmaps, the script replaces them with standard bitmaps and strips paths from the Corona bitmaps, which leaves empty CB husks. Maybe it would be possible to handle this somehow more elegant if not too much work for you?

Overall i really like those two little tools a lot - saves quite some manual work!
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-16, 22:03:48
Reply #6

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Tried both scripts briefly and i love them! I found few small issues with CP->AP script.

1 - anisotropy mapping is completely wrong. Judging from the visual preview the tool sets anisotropy to some off the charts value that's not even possible to set with the spinner. And that happens even if Corona material has zero anisotropy.
2 - bump strength gets ignored, it always converted to Autodesk's stupid default 0,3 which is really annoying. On the other hand i love when that happens with your other script, because in that case script inadvertently fixes stupid incoming bump to Corona's proper default, which is not good when you're working with old fashioned bump maps and arbitrary strength values, but great when you're dealing with normal maps.
3 - cosmetic issue - when Corona physical is populated with Corona bitmaps, the script replaces them with standard bitmaps and strips paths from the Corona bitmaps, which leaves empty CB husks. Maybe it would be possible to handle this somehow more elegant if not too much work for you?

Overall i really like those two little tools a lot - saves quite some manual work!

Sure thing.

1. Yeah the anisotropy is very different between the 2 engines. I had a feeling there was more work to do on this. Actually I made a typo so actually broken so ill update this soon and try it out and let me know your findings. This is with the typo fixed, weirdly the values show the same but the material ball looks correct, take a look at the bottom of this post. Its almost like the material editor doesnt update the values correctly but should be working... I might be missing something.

2. Can you show me what you prefer to happen with the bump map with some screenshots?

3. What do you mean empty CB husks? Can you show some screenshots?

Anisotropy:
anis-0" border="0

anis-1" border="0

anis-2" border="0

anis-3" border="0


Maybe also put your feedback for the Corona Physical to Autodesk Physical in that thread to keep it separate from this script for less confusion. - Conversation moved back to this thread, ignore this comment.
« Last Edit: 2023-07-17, 10:55:11 by James Vella »

2023-07-17, 07:57:48
Reply #7

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Ok give it a try, let me know your findings. Script attached to this post.

Version 1.2 Features:
- Bump & Normal map numeric values copied from Corona.
- Bitmap gamma from Corona and Corona Bitmap.
- All bitmap settings copied from Corona Bitmap (excluding the Output Curves).
- Anisotropy fix (hopefully, might need further testing as I have my doubts).
« Last Edit: 2023-07-17, 08:05:33 by James Vella »

2023-07-17, 11:05:52
Reply #8

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
I tried 1.2 and i see some issues has been fixed. Thank you!

#1 anisotropy [partially fixed] - zero anisotropy is now converting to 0 in Autodesk physical as well, all other settings are still wrong. I think that might be because i'm using Max 2024 and it seems you're still on the older version. It seems that Autodesk has changed something in the Physical material code, because i see in your screenshots that anisotropy has 0 to 100 (or -100 to 100) range, but in Max 2024 it has -1 to 1 range. Either way, i'm quite happy with this result so far, because i rarely use anisotropy, especially in materials that i need to "downgrade" to ADSK physical.

#2 - bump strength is now handled correctly, but the script no longer converts Corona normal node to Max normal node - i think it did so in previous version. Could you look into that please?

#3 - it looks that the issue with the stripped Corona bitmap paths is gone. Script works correctly here.

One additional issue - i noticed that if Corona bitmap is not plugged directly to material, but through some other Max node, like mix, composite, etc., then script does not convert those Corona bitmaps to regular bitmaps and leaves them like they are. It would be great if this can be fixed.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-17, 11:18:11
Reply #9

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
I tried 1.2 and i see some issues has been fixed. Thank you!

#1 anisotropy [partially fixed] - zero anisotropy is now converting to 0 in Autodesk physical as well, all other settings are still wrong. I think that might be because i'm using Max 2024 and it seems you're still on the older version. It seems that Autodesk has changed something in the Physical material code, because i see in your screenshots that anisotropy has 0 to 100 (or -100 to 100) range, but in Max 2024 it has -1 to 1 range. Either way, i'm quite happy with this result so far, because i rarely use anisotropy, especially in materials that i need to "downgrade" to ADSK physical.

Ah yes that would be much better actually with a -1 to 1 range. Unfortunately Im not using 3dsmax 2024 yet but might look into it soon. Dont hold your breath on this one.

#2 - bump strength is now handled correctly, but the script no longer converts Corona normal node to Max normal node - i think it did so in previous version. Could you look into that please?

Ah crap I broke it, thanks ill address this in the next update.

#3 - it looks that the issue with the stripped Corona bitmap paths is gone. Script works correctly here.

Great!

One additional issue - i noticed that if Corona bitmap is not plugged directly to material, but through some other Max node, like mix, composite, etc., then script does not convert those Corona bitmaps to regular bitmaps and leaves them like they are. It would be great if this can be fixed.

Ah yes you are correct, I can take a look at this for the next update. It wasn't working previously (it does work with standard bitmaps, not corona bitmaps). Thanks for spotting this. Also on this you want to keep those mix / composite nodes right? Hmm composite node should be fun lol.

2023-07-17, 12:18:56
Reply #10

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
One additional issue - i noticed that if Corona bitmap is not plugged directly to material, but through some other Max node, like mix, composite, etc., then script does not convert those Corona bitmaps to regular bitmaps and leaves them like they are. It would be great if this can be fixed.

Ah yes you are correct, I can take a look at this for the next update. It wasn't working previously (it does work with standard bitmaps, not corona bitmaps). Thanks for spotting this. Also on this you want to keep those mix / composite nodes right? Hmm composite node should be fun lol.

I think something like 95% of my converted materials are very simple, consisting of single bitmap node plugged into material slot, so personally for me it's not very relevant. I just accidentally noticed this issue and decided to report in case it's not too complicated to fix. If it's too much hassle to keep existing node structure, i would be content if the script would simply convert Corona bitmaps to bitmaps and plug those bitmaps directly to material (first bitmap in line would be fine, i guess), just please do not delete old composite, mix, or whatever nodes, so user could have reference how to rebuild the old node structure. That's my point of view on this. Other users might have other opinions, but since nobody else seems to care to give you the feedback... ;]
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-17, 14:34:42
Reply #11

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Hah yeah I also just use simple setups, but it would be nice for it to keep those nodes. Hopefully when I get my head around it ill post an update on that but... there is a workaround for now since its far more complicated than I expected.

Before you use the script use the Corona Converter to convert CoronaBitmap to Bitmap. This will keep all nodes in-tact mix/falloff etc and also makes sure all Bitmaps work correctly. This also means all your Output Curves and specific Bitmap settings all carry over correctly too:
cbitmap" border="0

Script attached to this post.

Version 1.3 Features:
- Fixed Normal node for Physical material with Normal/Bump textures

Edit:
Also if any devs would like to chime in as to why its so hard to recursively look for CoronaBitmaps that would be very useful insight. For example when recurvisely looking for standard bitmaps it works fine, when I try the same method with CoronaBitmaps I keep hitting walls.
All good, think I worked it out. Think it has to do with classinstances, probably easier to use that than what Im currently doing.
« Last Edit: 2023-07-17, 16:02:54 by James Vella »

2023-07-17, 16:02:32
Reply #12

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Ok fixed the CoronaBitmap conversion issue scene wide, turns out I was just overcomplicating it - noob mistake.Script attached to this post.

Version 1.4 Features:
- Converts CoronaBitmap to Standard Bitmap scene wide
- Keeps all nodes in the hierarchy eg. Diffuse > Falloff > Basecolor.png or Composite nodes etc. Doesnt really matter how deep the hierarchy goes it just searches for the Bitmaps/CoronaBitmaps.

Notes:
The official Corona converter which converts CoronaBitmap to Bitmap is far more fleshed out than this. It also handles Curves in the Output which mine doesn't. Ill get to this one day if its a user request. For now more interested in finding bugs in the current code or implementing other features that are necessary (user feedback).
« Last Edit: 2023-07-17, 16:45:10 by James Vella »

2023-07-17, 16:45:01
Reply #13

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Hi,

Thanks for your work, just a note because I quickly looked at the script. As you have discovered, using the getClassInstances way is the best to go. I'd not just walk through the materials and convert if CoronaPhysicalMtl or Multisub classes are found ("for i in sceneMaterials do"), but just like this instead:

Code: [Select]
for i in getClassInstances CoronaPhysicalMtl do
(
p = convertToPhysicalMtl i
replaceInstances i p
)

This way you get all CoronaPhysicalMtls, even those plugged into a Blend material for example. And you do not have to care about supporting all classes able to handle multiple material inputs. Same of course when it comes to CoronaBitmap conversion. For the latter, you may examine Martin Geupels original Corona converter script. Search for function "convertCoronaBitmapToBitmap" and "convertFrom_CoronaBitmap". Not sure when looking at the license info in the header if you would be allowed to just copy convertFrom_CoronaBitmap().

And: please check "animate off" context :) You could wrap the entire script into one to make it easy :)


Good Luck



Never underestimate the power of a well placed level one spell.

2023-07-17, 16:47:41
Reply #14

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Thanks Frood! Ill take a look at this when I'm fresh tomorrow.

Very good point about Blend materials, I didnt even consider that!

Yes I did see some script references with animate off, I was wondering if it makes much of a difference. Is that for the user in case they have it switched on?

2023-07-17, 16:58:22
Reply #15

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Hi,

yes, you are creating animation keys running the script without using "animate off" and having autokey active.


Good Luck



Never underestimate the power of a well placed level one spell.

2023-07-17, 17:53:30
Reply #16

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Hi,

Thanks for your work, just a note because I quickly looked at the script. As you have discovered, using the getClassInstances way is the best to go. I'd not just walk through the materials and convert if CoronaPhysicalMtl or Multisub classes are found ("for i in sceneMaterials do"), but just like this instead:

Code: [Select]
for i in getClassInstances CoronaPhysicalMtl do
(
p = convertToPhysicalMtl i
replaceInstances i p
)

This way you get all CoronaPhysicalMtls, even those plugged into a Blend material for example. And you do not have to care about supporting all classes able to handle multiple material inputs. Same of course when it comes to CoronaBitmap conversion. For the latter, you may examine Martin Geupels original Corona converter script. Search for function "convertCoronaBitmapToBitmap" and "convertFrom_CoronaBitmap". Not sure when looking at the license info in the header if you would be allowed to just copy convertFrom_CoronaBitmap().

And: please check "animate off" context :) You could wrap the entire script into one to make it easy :)


Good Luck

Holy crap, thanks Frood that is one hell of a shortcut. Thank you!

This is very helpful while I stumble my way through maxscript :D

Please feel free to join in the thread every now and then and guide my stupidity :D

2023-07-18, 14:09:21
Reply #17

James Vella

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

Version 1.5 Features:
- Bugfix: Normal_Bump, when 'add gamma' is used and texture is loaded as 2.2, automatically applies gamma 1.0 to Normal_Bump texture.
- Updated replace CoronaPhysicalMtl method: thanks to Frood. Which means it searches through all hierarchies such as Blend/Multi-Sub/Nested Multi-sub etc.

Corona Physical Material:
corona" border="0

Autodesk Physical Material:
phys" border="0
« Last Edit: 2023-07-18, 14:13:08 by James Vella »

2023-07-21, 21:30:25
Reply #18

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Hi James, found another minor issue. When converting Corona material and maps with stripped paths, only maps in Base colour slot remains with stripped paths, all other maps have they paths fully linked (assuming that before conversion their status was "found"). Not a biggie really, but if it's not too much work to fix this, that would be quite nice.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-22, 20:47:31
Reply #19

James Vella

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

Version 1.6 Features:
- Converting now works with stripped texture paths

Test it out and let me know if its working how you expect.

2023-07-22, 21:25:50
Reply #20

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Thank you!! I will let you know if i run into some more issues.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-22, 22:17:54
Reply #21

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
No worries.

One thing that got me thinking is that since it takes the whole node tree (Falloff > Mix > Bitmap) it could potentially be an issue for those who use any Corona classes such as (CoronaColorCorrect > Bitmap) or (CoronaMultiMap). Considering those 2 classes alone have things that dont translate to standard (Color Correct) then it wouldn't appear the same anyway. I would also like to keep the script simple (for now) with just a click/run scenario instead of building a UI that asks you questions.

Maybe once this one is bug free and covers most user requests (which is just you so far romullus haha) ill just adapt it to a second script that removes all corona class nodes between the Diffuse > Bitmap. This would be the FBX exporter version of this script. Just me thinking out loud FYI.

2023-07-23, 07:08:44
Reply #22

James Vella

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

Version 1.7 Features:
- Bugfix for CoronaNormal resetting bitmap settings (U/V offset etc.) when using CoronaBitmaps

2023-07-24, 15:54:02
Reply #23

James Vella

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

Notes:
- I updated the script to match how it works in the PhysicalToCorona script scene wide, only for objects with materials applied. Figured you might want this for this script as well romullus :)
- Just realized another bug when Add Gamma is enabled... wont copy bitmap settings such as U/V offsets etc. Ill come back to this with a fresh head. (these CoronaBitmaps are not so easy to work with, its difficult to troubleshoot :S)
- Ok worked out that bug above, updated in this version.

Version 1.8 Features:
- Materials convert only for scene materials that are applied to objects
- Bugfix for CoronaNormal stripped paths reverting when 'Add Gamma' enabled
« Last Edit: 2023-07-24, 16:43:50 by James Vella »

2023-07-24, 18:44:29
Reply #24

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Nice! Thank you! :]
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-25, 10:26:15
Reply #25

romullus

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

I noticed an issue that is not directly related to your scripts, but rather to how Max is managing the scripts and customization. I dragged your scripts to the viewport and added them as a buttons to the toolbar. max automatically has copied the scripts to 3ds Max>ENU>usermacros folder for future reference. So far so good. The issue is that now when i download new version of your script and drag it to the viewport, Max is updating the script, but doesn't copy it to usermacros and referencing to it from download folder instead. This is especially problematic because after restart old version from the usermacros folder is being used and not the recent version, unless i drag and drop the newest file again. I probably could rename the recent script file and place it to the usermacros folder manually and that should work permanently, but since your scripts are being developed at the rapid pace, that procedure would be quite a chore. I wonder if there's more convenient way to handle this?

P.S. i just realized that because of this issue, i might had given you false feedback quite a few times :/


Scratch that, it looks like i misunderstood how Max is handling this, when it copies script to the usermacros folder, it strips comment section with script version and that part has confused me. It looks that actual script is updated properly and i was always using the recent one. Sorry for the confusion.
« Last Edit: 2023-07-25, 10:35:40 by romullus »
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-07-25, 12:34:32
Reply #26

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile

2023-07-25, 13:50:34
Reply #27

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
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.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2023-09-13, 13:10:53
Reply #28

Ink Visual

  • Active Users
  • **
  • Posts: 169
    • View Profile
Hi James!
Many thanks for you script, it works great!
I encoutered a problem in one of our scenese where it gave me an error referring to one of the Corona Mix maps we were using.
All converted fine when I removed this map from the scene. Shall the script be also converting Corona Mix map  to composite?
Thanks!

2023-09-13, 14:03:51
Reply #29

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Thanks for the feedback and comments Ink Visual.

Converting to composite will be quite a big job, Ill take a look later this week and see if something is doable - otherwise no plans at this stage.

Regarding the script crash, I can update it so it warns you instead but continues to work either way.

As an alternative do you think it would be ok to extract the "Base Layer" and use that bitmap instead? Or do you need the composite for Physical material?

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: 8856
  • 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: 8856
  • 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: 8856
  • 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: 8856
  • 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: 8856
  • 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 »