Chaos Corona Forum
Chaos Corona for 3ds Max => [Max] Corona Goodies - User Contributions => Topic started by: Nik on 2016-08-21, 10:15:32
-
(https://dl.dropboxusercontent.com/s/0hth0s4l21j8986/batchmedit1.7.png)
ScriptSpot link (http://www.scriptspot.com/3ds-max/scripts/batch-material-editor)
Macros category - "Nik Scripts"
-
Hi there
this is something I am looking for a long time. I am happy :-)
I would like it to add the script as a shortcut to a toolbar.
In which category do I have to look for the script?
If there isn't one at the moment, I would suggest the "Cororna Renderer" category. As Deadclown placed his script under this category as well.
Regards
Johan
-
I wasn't sure that somebody will be interested in this script :)
There is no macro for now. I will make it today
UPD. I did that
-
This looks great. Thank you! Will try it soon.
-
Wait, today I will upload new v1.3 with some bugfixes, adaptive dialog height and code optimisation.
UPD. v1.3 ready
Feature requests are welcome :)
-
One feedback for you: could you please allow for 4-digit integer input. Currently 99 is max value.
-
Script finds valid range of values for each parameter. I described all of them in code.
If some integer parameter is limited by 99 then it's limited in UI of shader too. Or it's a bug and I need to fix it :)
For all undescribed parameters script will limit you by 999999999 :)
What exactly integer parameter are you talking about?
-
Script finds valid range of values for each parameter. I described all of them in code.
If some integer parameter is limited by 99 then it's limited in UI of shader too. Or it's a bug and I need to fix it :)
For all undescribed parameters script will limit you by 999999999 :)
What exactly integer parameter are you talking about?
Trying to set Material GBufferID >99
The spinner allows me to go to 9999
-
Yes, this is my mistake, I fixed it.
Redownload please.
-
Yes, this is my mistake, I fixed it.
Redownload please.
Awesome work mate! Great script... already helped me a tonne today doing loads of mat tweaks across a bunch of scenes. Thank you.
-
Hi,
just downloaded the new version and tested it. So far so good :-)
Would it be difficult to add the option the change values of a Standard Bitmap?
For example I have a Multi/Sub-Object with 10 different Corona materials and each material has a Standard Bitmap in the diffuse slot.
I would like to change all the RGB Levels in the Output Slot of the Bitmaps from 1.0 to 0.9.
-
Actually maps get things more complicated. But I'm interested in this feature and it think I see a good way to realize it.
UPD.
Well, I tried and I failed :) Maps could be nested in other types of maps. Code doesn't support maps at this moment. UI must be remaked too.
So now I can't promise that this feature will be implemented.
-
OK no problem
Thanks for the effort!
-
Hi and thanks for such a useful tool - previously for such tasks I used Modifier Modifier Zorb http://www.scriptspot.com/3ds-max/scripts/modifier-modifier-zorb - it surely has lots of features and even some randomization functions but is a major pain in youknowhere to use it as it is so goddamn slow to update selections and do any operations with or at least so on heavier scenes - yours on the contrary is lightning fast and gets the job done too.
There's a couple of features I miss which would be good if you could implement in your script :
Standard bitmap filtering amount
Standard bitmap filtering type
Corona bitmap filtering amount
Corona bitmap filtering type
Those alone could save quite a lot of time for sure
Not present in zorb or anywhere else (with some exception which I will explain below) and probably harder to implement but surely most useful ones
Adding some sort of intelligent modes\settings\constrictions for setting levelDiffuse value - namely:
- ignore materials with overall diffuse color brightness lower than some user set threshold - that would be tremendously useful for ignoring some metal materials with a dark or black diffuse present in the scene and setting all others to say 0.8 as well as ignoring all materials which were set up right in the first place (say level 1.0 but grey diffuse etc.) for more albedo trouble free rendering - I did ask Martin (DeadClown) for such a script and he did a sort of it quite a while ago, gave it to me and some other users, but because he didn't want newbie users to misuse that (as there are some possibilities to do so for sure) he didn't share it with the public - probably you could ask him how he did that or maybe he will even let you integrate his script or part of it into yours
- ignore materials whith diffuse level\strength controlled by the user set threshold - would again let script to ignore already well set up materials albeit in a different manner than the one above
- ignore materials with refraction level\strength controlled by the user set threshold - self explanatory )
- ignore materials with reflection level\strength controlled by the user set threshold - self explanatory )
Hope those are possible to do as I think such options could really benefit every Corona user our there and save lots of time dealing with, for example, some initially properly set up corona scenes to which, at some point, some simply converted by CM/LC and unchecked due to a creative/deadline rush models were added (especially when those were converted from some obscure material setups containing models) - well, you know how that might go when those are not checked in time and it's too late to go correcting them one by one ))
-
Wow, that's what I call feature request! )
I understood all of these and will try to implement as well as bitmaps parameters. Its complicated but doable
-
Nice idea nik684, thanx :D
-
v1.35
- In 1.3 script wasn't optimized for parsing thousands of objects or materials. Not it's MUCH faster.
I tested it on scene where I have 8000 objects, 625 CoronaMtls, 167 Multimaterials. Processing time of changing one property of all materials - 100-300 milliseconds.
3dsMax needs to redraw viewports, and this takes 1-2 seconds, but script itself is pretty fast. Processing time will be printed in Listener.
- IMPORTANT. Fixed error caused by invalid search.
- "All materials" and "Selected materials" buttons that starts changing property will be disabled when list is empty (if search is invalid) so you can't do anything useless anymore :)
And kinda roadmap:
v1.4 (soon will be finished)
- all bitmap and coronabitmap properties will be editable
- select and change more than 1 property, if all of them in one class (float for example)
v1.5
- ignore materials by some parameters:
- by average diffuse color (based on colorDiffuse, not on maps inside Diffuse slot)
- by Diffuse level value
- by Refract and Reflect values
-
nice!
-
Nice indeed, glad to see my ramblings were not in vain ))
About - ignore materials by some parameters:- by average diffuse color (based on colorDiffuse, not on maps inside Diffuse slot) - yeah, my bad, forgot to specify\suggest that this should only work on Diffuse color as even I (being totally nonprogrammer type) can understand, what, even if it could be done by analyzing maps or even worse, some combinations of maps done through coronaAo\mixes\composites\etc. it would take ages for a script to do it's work, so sorry about that somewhat unspecific\erratic way of expressing my thoughts )
-
"Select objects by MaterialID" button would be very useful as for me...
Look at this http://www.scriptspot.com/forums/3ds-max/general-scripting/select-multiple-objects-by-material-id#comment-19340
-
I'm afraid this feature is irrelevant to batch material editing, so I can't add it to this UI.
Anyway Miauu has wrote it, right? :) He has more script skill than me.
-
Well, it seems I have wrote something good :)
v1.4
- Properties now sorted by class and name. Class is visible in list
- You can filter them via filter class presets buttons or/and by name
- Now you can select multiple properties IF all of them share similar output values
- Bitmap and Coronabitmap properties.
Not all properties were added to UI cause I'm not sure somebody will batch edit them.
When you change some property it will be enabled automatically (you can disable it if you don't want to change it) and when you're ready click GO and...
All bitmaps in all selected materials in all selected slots will change all enabled properties. This can take a long time in big scenes. Maybe even 1 or 2 seconds! :)
- I suppose script again could be faster than before because I rewrote all of it
Actually I didn't test this version too much, so if you'll find some erorrs - post it here immidiately.
Enjoy
-
v1.5 is ready
- Ignore materials by some properties. Works with CoronaMtl and VrayMtl
- VrayMtl is tested without Corona installed
-
Well, great job ! It already helped me a lot when dealing with some multitexture material filtering setups I needed to do today - even that seemingly simple feature can be quite a huge time saver in some cases - thanks for adding that too. Later I will test ignore materials by properties and will report on how they fare - it seems I've got just the right scene for testing that ))
-
Ignored materials - materials that matches all enabled criteria in list, not one of them.
"criterion 1 and criterion 2" but not "criterion 1 or criterion 2"
I.e. if you'll enable Diffuse avg and Reflect Ior criteria, then materials with diffuse avg value more/less than something AND reflect ior more/less than something will be ignored. But if material have diffuse value in valid range then it wont be ignored.
I'm not sure I can explain it better :)
Just try this feature
-
Posted 1.6 with some nice new features
-
Fantastic stuff, well done!!!
Dionysios -
-
It is getting better and better. Keep up the good work!
-
Angle W bug fixed.
Version is the same. Please redownload.
I'm sorry but for now CoronaLayered materials are not supported in "Selected objects" mode.
I'm working on next version where I will fix that and add "Medit Selection" mode for Compact and Slate material editors.
UPD.
Materials selection from Slate is nearly impossible. Thx to Autodesk.
Maybe I'll add Compact medit slot selection for those people who need edit multiple bitmaps inside specific multimap.
CoronaLayeredMtl could be added for editing bitmaps in masks. I don't see other usable properties in LayeredMtl.
-
I decided to remove ChangeLog on top, so this message is just for history :)
v1.6:
- Added. Randomization of any float and color values.
- Added. Size, offset, angle parameters for Bitmaps and CoronaBitmaps.
- Added. Clear all maps in selected parameters (map slots). You can undo that
-
I know, I told you that Slate selection is nearly impossible. Well, just nearly :) I implemented that with small restrictions.
v1.7
- Added. Medit selection material mode (Read Help)
- Added. Medit selection map mode (Read Help)
- Added. Help on forum and Help button in UI
- Added. Message string for errors and summary info
- Added. GO button will be disabled when properties selection is invalid
- Added. Dialog will save Position, Mode and Filter in current 3dsMax session
- Modified. Ignore materials renamed to Exclude materials
- Modified. New intuitive UI in Exclude materials
- Modified. Bitmaps UI is not locked by default
- Modified. Bitmaps switches automatically enabled when property is modified
- Modified. Now randomized value can't be more or less than valid value
-
Hi there
will it be possible to implement all the CoronaNormal parameters in your script?
-
Hard to say. For now it's a Material editor, not Maps editor.
Bitmaps are important part of materials so I implemented their properties, but implementaion of all properties of all maps needs new complicated UI.
Why do you need that? For some batch procedures I write couple of strings, do the job and even don't save them. If you'll describe your task maybe I can write some code.
Or you can use Soulburn Scripts and choose Parameters Manager.
Then:
- Select objects with normalmaps
- Go to Params manager. Select "Maps in sel objects", then click "Refresh" if no Maps were found.
- Choose parameters and set them.
It's a bit buggy but universal.
-
Hi, yes this is on map base and not on material base. So I understand why you are not planning to do this.
But if it is not that difficult to write some lines of code I will be quit happy.
It is a batch job that I have to do:
I need to change the "strenght multiplier" in all the CoronaNormal maps to "5" and "check" the "Flip Green" checkbox.
The mesh consist out of a CoronaLayered Material with several CoronaMaterials and I need to change all the CoronaNormal maps inside the Bump slot of the CoronaMaterials.
Hope this is clear?
If you have a Paypal donate page, I will make a donation.
-
for map in (getClassInstances CoronaNormal) do (
map.multiplier = 5
map.flipgreen = on
)
This will parse ALL normalmaps in scene.
You own me 700 dollars :)
I'm joking of course
-
for map in (getClassInstances CoronaNormal) do (
map.multiplier = 5
map.flipgreen = on
)
This will parse ALL normalmaps in scene.
You own me 700 dollars :)
I'm joking of course
Gosh, this is great. Many thanks
-
1.7.1
These bugs are fixed:
- Clear map slot
- UI disabling behaviour
- GO button disabling behaviour
- Previous mode
-
Thank you for this very useful script!
-
I'm surprised nobody didn't notice that batch editing of maps were broken in 1.7.1
I found it myself today and urgently fixed it. Version 1.7.2 uploaded
1.7.2
Bugfixes:
- Maps mode didn't work at all
-
Hi there, maybe I'm a blind idiot and just simply cannot find it but I don't see any of CoronaAo parameters exposed in Batch material edit which might be quite handy when dealing with some monstrous materials such as this one http://c2n.me/3JGknsH - in case you are curious what this particular material does it's this https://www.flickr.com/photos/119850875@N05/30823829206/in/datetaken-public/ old, a little mossy, crumbly, leaky, semipolished by constant walking on and generally nasty looking concrete material I've been trying to do some time ago )) Anyway maybe I just don't see those parameters exposed but I don't hence I write this request. On top of that it would be nice to have same batch control capabilities for CoronaRoundEdges and for CoronaDistance as well - the latter being not too necessary but why not - could save some time when dealing with some assets made using different system units etc. And thanks again for such a time saver which Batch material edit is.
-
1.7.4
- FStorm material and bitmaps support
- Small changes in Exclude rollout
- Shaders list will contain only shaders available in current render engine
- .ms file is removed. You can always replace first line of script to one symbol "(" if you need .ms file
- Script is now called "Batch Material Editor" without "Corona"
- Script is now only on ScriptSpot for my ease
- Macro Category was changed to "Nik Scripts"
I'm sorry, but you need to delete old macro from "C:\Users\***\AppData\Local\Autodesk\3dsMax\2016 - 64bit\ENU\usermacros" and install new one.
I need this script to be independent from Corona so I changed category and moved script from CoronaForum to ScriptSpot.
I removed Help text as well, because I'm not sure if somebody even need it. I have a big image with tips, maybe it's enough. If not - I will write help on ScriptSpot.
-
I don't see any of CoronaAo parameters
As I mentioned before this script is Material editor, not Maps editor. At least for now. It can't help in all possible situations.
I can't promise that script will support all these maps in future.
There is at least one free script for your case - Soulburn ParameterManager. It can edit any property of any map or material but UI is complicated and there are some bugs.
-
Yeah know that one and as well as "hellish" mod mod Zorb but yours is light-years ahead in terms of user-friendliness and speed (which you probably know)) but thanks for suggestion anyway )
-
I get a Macroscript Error Exception when I click the BatchMat button. "--Runtime error: array index must be positive number, got: 0"
Nik Scripts-BatchMedit.mcr, line 54: selectedMtlClass = classof MtlClasses[nsBatEdSavedShader]
Any ideas?
-
I've made a dirty hotfix but it should work. Redownload please
-
I get the same error, different line of code though.
NS_BatchMtlEditor_1.7.4.mcr Line 767: selectedMtlClass = classof MtlClasses[ddlMtlClass.selection]
-
Which render engines do you have installed? Vray, Corona, Fstorm. From this list only
-
Just Vray and Corona, I noticed that all my compact material slots are standard materials, is that the cause?
-
No, I think it's because of your Corona version. Can you open Listener (F11) and write there
classof renderers.current
And post result
-
Corona_1_5__hotfix_2
-
Yea, render class was changed after 1.5. I will fix it today.
Fixed.
And one more thing. Can you switch to Vray and do the same "classof renderers.current"? And tell me Vray version as well.
-
Hey, sorry, didn't see your edit, it's: V_Ray_Adv_3_20_03.
It is working just fine now though, thanks dude!
-
So you're okay with latest version of script? Does it work?
-
yes, I don't get the error anymore, did you change anything? All I did was switch renderers around
-
Of course I changed :) it was only my fault. New feature (show compatible mats only) was implemented a litte wrong.
-
Hey, I get the:
-- Syntax error: at ), expected <factor>
-- In line: )
3ds max 2017 + Corona 1.6
Can you suggest how can I fix this?
-
Hey, I get the:
-- Syntax error: at ), expected <factor>
-- In line: )
3ds max 2017 + Corona 1.6
Can you suggest how can I fix this?
I sent you PM. Can you give me string number and please try to redownload 1.7.4 version because I have failed one day and made changes right in Dropbox, so somebody could download WIP code :D
-
damn this is awesome, big time saver. Thank you sir !
-
damn this is awesome, big time saver. Thank you sir !
You're welcome :)
-
It took me some time to figure out why I got no rollout visible on script execution.
Before I checked it's predefined position which is [1500, 120]. (I'm on a pretty old laptop with [1366,768] max resolution)
I'd change that value to something like sysInfo.DesktopSize / 2.0
And something bad happens at line 56 when I try to run it with a fresh scene.
>> MAXScript MacroScript Error Exception:
-- Runtime error: array index must be positive number, got: 0 <<
selectedMtlClass = classof MtlClasses[nsBatEdSavedShader]
Hope it'll help you make it better
-
Good idea, thanks. I will do that.
Ah, actually not so good because DesktopSize summarizes all monitors sizes. So I will just decrease default x.pos to something like 200. I hope noone have monitor less than 200px :D
-
v1.7.5
- Added. VRayHDRI map partly support.
v1.7.6
- Fixed. Default X position now 200px instead of 1500px, for people who have small resolution screen.
- Fixed. Error when current renderer is not supported.
-
v1.7.7
- New. Last used settings now saved in .ini file and works between 3dsMax sessions.
- Fix. Exclude by reflect ior FStorm didn't work.
-
v1.7.8
- New. Script will use shaders and maps that compatible with current renderer. For example VRayHDRI even in Corona.
- Fix. Renderer identification system is removed. All related errors should be fixed.
- Fix. Mode radiobuttons last state was broken.
-
v1.7.9
- Fix. It was a bad idea to fill list with compatible shaders only. Now list contains all supported shaders if renderer is installed.
- Fix. Error when last operation was "Clear map slot" and checkbox was enabled.
P.S. How to make it good? Make it bad and then revert changes :)
-
How did I only just stumble across this! this is awesome!!
thank you so much for sharing this
-
Hello,
Just discovering this one, great !! thank you, Nik :)
-
Hi Nik. Thank you so much for this script. I was wondering if you could build in a material-rename function, similar to 3dsMax's rename objects tool, but for materials instead?
I've been looking for a script that could do this, but haven't found anything useful so far.
Thanks again
-
Hi Nik, what a wonderful script this is! It's a shame i discovered it only now. A question from the new user - is it possible to edit CoronaNormal map attributes? It seems i can't find it on my own.
-
Hi Nik
Great script.
It would be awesome if you could batch add a corona color correct to all diffuse channels in the object or multi map (or other channels such as reflection, translucency etc). This would work in well with Corona's new color correct "take settings from map" function.
Cheers
-
Sorrry for a late reply.
I'm busy at my job and writing another script so Batch Medit 2.0 maybe someday will be implemented, but not soon for sure.
"material-rename function"
- Soulburn scripts has such feature in renamer.
"is it possible to edit CoronaNormal map attributes?"
"add a corona color correct to all diffuse channels"
- Unfortunately no. Script needs some changes to support all maps. Now it's just a material editor, not map editor.
-
HI,
I'm new user...it seems an useful script!But I don't understand where can I download it? I found the link (in the website download URL) with the script "written"...but how can I use the script in Max?
-
Sorry. I fixed download link, so file should download instead of opening in browser.
This is a macro, so you need to run it and it will be installed to 3dsmax. Then you should find Batch Medit in NikScripts category and drag it to toolbar or menu.
-
Hi!Maybe it's me...but it keep opening in the browser...
Maybe I'm doing something wrong...It's here right?
-
I changed link right before previous message. Refresh scriptspot page
-
Oh yeah...thank you, very kind.;)
-
I'm using 3dsmax 2020 and trying to get your script to run, I run script and load it and nothing happens. Looks like an awesome script, does it not work with 3dsmax 2020?
-
This is a macro, it installs to category Nik Scripts when you run it.
Then you should go to Customize UI and check this category to add button/hotkey/menu
-
This is a macro, it installs to category Nik Scripts when you run it.
Then you should go to Customize UI and check this category to add button/hotkey/menu
Okay great, got it! Can't wait to try it, thank you.
-
Just a quick shout-out for this epic script!
-
Hi Nik,
Do you have any intentions to update the script to work with Corona 7 and the new CoronaPhysicalMtl?
-
Hi Nik,
Do you have any intentions to update the script to work with Corona 7 and the new CoronaPhysicalMtl?
+1
Best script ever. Can't wait for this to be updated!
-
As much as i'd want the script to be updated for the new material, but it's unlikely to happen - AFAIK Nik doesn't use Corona anymore.
-
Is someone would be able to do it maybe :) ?
(with Nick's authorization of course)
-
I wonder if anyone at Chaos Czech would be willing to take this on as an official part of Corona? It's a hugely beneficial script!
-
Hmm. I didn't realise how popular this script is.
It was written long time ago and I don't want to edit that ugly noob code.
Instead, I plan to write v2.0. I will create a system that will add any new classes automatically without any updates from my side. I suppose something similar was implemented in Zorb but for some reason people prefer my script (IDK why).
BTW, feature requests are welcome
-
Amazing news Nik! As for why I personally prefer your script over Zorb, it's just much simpler to look at and use, as an artist. Zorb is a huge sprawling thing, great for other things for sure, but for making quick edits to batches of maps/materials your script is 10/10.
-
We have this logged as a feature request for Corona.
(Report ID=CRMAX-540)
-
I have 2 news about BatchMedit, good and bad.
Bad - I have no time to develop v2 in the near future.
Good - I added CoronaPhysicalMtl to the old disgusting v1 so at least the new shader is now supported in v1.9.
It can be downloaded on the scriptspot.
-
Ugly code or not, this tool is invaluable time saver. Thank you very much!
-
Thanks Nik! just started using it like a month ago, it a super nice tool for that ugly bad models and its shaders!
-
Thanks Nik, you're a legend.
-
Good - I added CoronaPhysicalMtl to the old disgusting v1 so at least the new shader is now supported in v1.9.
It can be downloaded on the scriptspot.
Thanks A LOT, Nik :)
-
I have 2 news about BatchMedit, good and bad.
Bad - I have no time to develop v2 in the near future.
Good - I added CoronaPhysicalMtl to the old disgusting v1 so at least the new shader is now supported in v1.9.
It can be downloaded on the scriptspot.
Thank you! You are the best! S2
-
I have 2 news about BatchMedit, good and bad.
Bad - I have no time to develop v2 in the near future.
Good - I added CoronaPhysicalMtl to the old disgusting v1 so at least the new shader is now supported in v1.9.
It can be downloaded on the scriptspot.
Hello Nik,
First, I want to thank you for your script. It helps a lot to quick correct come basic parameters for old vray shaders for vray itself or before vray to corona conversion.
As you told, you do not have the time for developing v2 in the near future. But maybe sometime it will be possible again…
If so, may I ask you for a feature, which I believe will make your script even better.
Situation: Let's say I have an old pre-PBR scene in vray. Basically, as starting point I make bunch actions like : set BRDF to GGX+glossy Fresnel, then enable Fresnel, then set IOR to 1.5, then link refraction&reflection IOR, then reflection to white, then disable self-illumination for GI, than refraction to black and so on. Right now, we need to do all this actions separately.
It will be really great to have the possibility to save the actions in presets and then use the saved presets.
I hope you will find the idea useful.
Thanks a lot, again!
-
Thanks for good idea, I like it.
Actually v2 is already in lazy development but still needs a lot of time. Presets are in "todo" list as well.
-
Thanks for the info, quick reply and your effort, Nik !
-
@nik With this tool can I add a CoronaRaySwitch color 190,190,190 on 500 individual materials?
It's for a photogrammetry model of a city.