Go Back   SplutterFish Forums > SplutterFish Client Forums > Scripting / Bonus Tools (MaxScript)
Login
Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-Jan-2010, 05:02 PM
thigas1 thigas1 is offline
Member
 
Join Date: Jan 2008
Posts: 33
Default b2 converters

Here in my office we decided to stop using 3dsmax 2008 to use the new 2010. However I realized I can´t really make the change. I need the 2008 to be able to convert textures, specially from vray to b2.

I know the b2 converter is not working for there is no b1 plugin for 2010. Is there a way to make it work only for the vray converter (uh... a mental ray converter would be very much appreciated)?

Another thing is how to set the defaults from the brazil advanced material.
Most of my textures use a relection/refraction sample rate of 5, and max error 0,2. I only crank this up for a few items, specially if they are close to camera.
Reply With Quote
  #2  
Old 08-Jan-2010, 07:15 PM
RichardAnnema's Avatar
RichardAnnema RichardAnnema is offline
Automated Posting Zombie Machine
 
Join Date: Jul 2002
Location: The Netherlands
Posts: 9,409
Default

The converters dialog should pop up just fine without b1 installed - but all of the b1-specific items will be disabled. I'd guess the V-Ray ones would still work.

You can't really set defaults for any of the Brazil bits and pieces in general - you could set one up in a material library the way you like it and grab from there when doing a Get Material -> Library (I've got one set up that way so I don't have to wade through all the materials and maps I hardly ever use and get some more sensible defaults in other things.. like the checker map tiled to 4x4).

Come to think of it - I *guess* a callback on material creation -might- be able to apply some custom defaults, no matter what the source. Although.. that would also be the pitfall - if you got it from a material library, I don't think there's an immediately obvious way to distinguish it from one picked from the Get Material -> New dialog.. short of comparing settings and other potential headaches.

... in fact, just looking at my callbackLogger script output, that seems an iffy ordeal to begin with.. lots of messages where I would rather see just one :>
Code:
GE: #mtlRefAdded @ 76517044
GE: #mtlRefAdded @ 76517054
    Material #4:Brazil2_Advanced
    Material #4:Brazil2_Advanced
GE: #mtlRefAdded @ 76517064
    08 - Default:Standard
GE: #mtlRefAdded @ 76517074
    Material #4:Brazil2_Advanced
GE: #mtlRefDeleted @ 76517174
    08 - Default:Standard
GE: #mtlRefAdded @ 76517194
    Material #4:Brazil2_Advanced
GE: #mtlRefDeleted @ 76517204
    08 - Default:Standard
GE: #mtlRefAdded @ 76517224
    Material #4:Brazil2_Advanced
GE: #mtlRefDeleted @ 76517395
    08 - Default:Standard
GE: #mtlRefDeleted @ 76517405
    08 - Default:Standard
GE: #mtlRefAdded @ 76517415
    Material #4:Brazil2_Advanced
GE: #preRenderEval @ 76517735
    0f
GE: #preRenderEval @ 76517775
    0f
__________________
__________________
Richard Annema
Director of Client Relations
SplutterFish
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #3  
Old 29-Mar-2010, 09:46 AM
pokoy pokoy is offline
Senior Member
 
Join Date: May 2008
Location: Darmstadt, Germany
Posts: 170
Send a message via Skype™ to pokoy
Default

Got the same problem here, converter doesn't offer conversion of vray mats to b2 mats, I guess because b1 is not present with max 2009 (like mentioned above). Any quick way to update the script to make the vray conversion work?
Reply With Quote
  #4  
Old 29-Mar-2010, 11:25 AM
RichardAnnema's Avatar
RichardAnnema RichardAnnema is offline
Automated Posting Zombie Machine
 
Join Date: Jul 2002
Location: The Netherlands
Posts: 9,409
Default

ah shoot... I guess the V-Ray one is getting disabled after all.

Hacky solution - run the following maxscript before accessing the converters:
Code:
plugin helper b1_dummy name:"b1dummy" classID:#(1387076610, 288174012) category:"Standard" extends:dummy invisible:true ( )
I have no idea what max will do if you happen to load a scene with b1 assigned, given the classID clash there

non-hacky solution in the form of an updated script pack to follow
__________________
__________________
Richard Annema
Director of Client Relations
SplutterFish
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #5  
Old 29-Mar-2010, 11:59 AM
RichardAnnema's Avatar
RichardAnnema RichardAnnema is offline
Automated Posting Zombie Machine
 
Join Date: Jul 2002
Location: The Netherlands
Posts: 9,409
Default

Quote:
Originally Posted by RichardAnnema View Post
non-hacky solution in the form of an updated script pack to follow
https://splutterfish.com/sf/f/custom...s_BrMaxPro.mzp

Also listed on your Account page.

The only change in this version compared to the shipping version is the issue addressed in this thread. I would recommend downloading it only if you happen to need this particular change.

To replace the existing script pack, simply copy the file to
Code:
<max>\Scripts\StartUp\
. If you have the Pro-Beta script pack installed, you may delete the file
Code:
<max>\Scripts\StartUp\sfscripts_BrMaxPro.mzp
to prevent unnecessary loading of that pack (this newer version will replace it once loaded).
__________________
__________________
Richard Annema
Director of Client Relations
SplutterFish
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #6  
Old 29-Mar-2010, 12:29 PM
pokoy pokoy is offline
Senior Member
 
Join Date: May 2008
Location: Darmstadt, Germany
Posts: 170
Send a message via Skype™ to pokoy
Default

Thanks Richard! Currently converting one scene manually but still have three or four waiting, so this will certainly help me out.

Edit: That was fast!
Reply With Quote
  #7  
Old 29-Mar-2010, 04:37 PM
pokoy pokoy is offline
Senior Member
 
Join Date: May 2008
Location: Darmstadt, Germany
Posts: 170
Send a message via Skype™ to pokoy
Default

No success here, Vray conversion is available but it doesn't convert anything. It reports 'converted' for blends and multi materials and 'err' for all plain Vray mats, zero for 'fail' - but it fails completely, no B2 materials in the scene after convesion. Probably doesn't work with the latest Vray version(s)..?
B2.2 Beta Build 1644, Vray Adv 1.5 SP4a, max 2009 64bit

I'll try to avoid using Vray in future, really
Reply With Quote
  #8  
Old 29-Mar-2010, 05:23 PM
RichardAnnema's Avatar
RichardAnnema RichardAnnema is offline
Automated Posting Zombie Machine
 
Join Date: Jul 2002
Location: The Netherlands
Posts: 9,409
Default

Quote:
Originally Posted by pokoy View Post
No success here, 'err' for all plain Vray mats
The MaxScript Listener (F11) should contain a more detailed report on what went wrong.

If it is indeed some manner of change in the source material, please select one of those (not inside a blend/etc.) in the material editor, run the following script, and attach what it prints out to a reply

Code:
(
    fn recurse el rpt indent:"" = (
        if (isKindOf el MaxWrapper) then (
            format "%% | % | %\n" indent el (classOf el) (el.classID) to:rpt
            showproperties el to:rpt
        )
        propNames = getPropnames el
        for prop in propNames do (
            propVal = unsupplied
            try ( propVal = getProperty el prop ); catch()
            format "%.% = %\n" indent (prop as string) propVal to:rpt
            propValClass = classOf propVal
            if ((propValClass == ArrayParameter) OR (propValClass == Array)) then (
                for i = 1 to propVal.count do (
                    val = propVal[i]
                    if (val != undefined) do (
                        try (recurse val rpt indent:("  [" + i as string + "]" + indent)); catch()
                    )
                )
            )
            else if (isKindOf propVal MaxWrapper) then (
                try (recurse propVal rpt indent:("  " + indent)); catch()
            )
        )
    )
    recurse meditMaterials[activeMeditSlot] (newScript())
)
__________________
__________________
Richard Annema
Director of Client Relations
SplutterFish
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #9  
Old 29-Mar-2010, 05:36 PM
pokoy pokoy is offline
Senior Member
 
Join Date: May 2008
Location: Darmstadt, Germany
Posts: 170
Send a message via Skype™ to pokoy
Default

Ok, text files attached.
'Converter_output' is what listener says after the convesion attempt, 'Script_output' is the output from the script posted above.
Attached Files
File Type: txt Converter_output.txt (1.4 KB, 30 views)
File Type: txt Script_output.txt (31.4 KB, 31 views)
Reply With Quote
  #10  
Old 29-Mar-2010, 08:51 PM
RichardAnnema's Avatar
RichardAnnema RichardAnnema is offline
Automated Posting Zombie Machine
 
Join Date: Jul 2002
Location: The Netherlands
Posts: 9,409
Default

that doesn't look like it should have failed in any way...

With a VRayMtl (again, not inside any other materials, just to short-circuit that potential problem) selected in medit, let's try through the innards of the converter...
Code:
sfs.b2_converters_init() -- may be needed if you haven't accessed the converters UI yet
newMat = sf_b2_converters.convert meditMaterials[activeMeditSlot] convdir:#vrb2
That should return a new material of Brazil2 Advanced type. You can then assign it to e.g. medit slot 2 through:
Code:
meditMaterials[2] = newMat
If it returns 'undefined', then for some reason it didn't think the VRay material was, in fact, a VRayMtl (the script output shows that it should be, so that would be odd).

Either way, a report should get dumped to the listener again.
__________________
__________________
Richard Annema
Director of Client Relations
SplutterFish
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 07:00 PM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.