Home Technical Talk

Help Needed! - Maxscript FBX Exporter and Vertex colors .fx shader

polycounter lvl 9
Offline / Send Message
CastorPT polycounter lvl 9
Hi,

I've been looking around but with no luck so I now turn to Polycount for help :)

Q1.
Do you guys know where I can get a good (ideally free) DirectX shader for 3Dsmax 2012 that allows me to see vertex color blending textures in the viewport? (a simple black to white vertex colors)


Q2.
I'm doing a lot of Max to Maya FBX export and need to speed up the process.
The steps I do are:
  1. select objects,
  2. apply a edit poly
  3. export as FBX to a specific file
  4. remove edit poly


My maxscript skills are not that great so the best I could do was use the maxscript listener, do the actions and save that to a button. But I still have to go trough the dialogs for the FBX export and confirm overwrite of the .fbx file.
Is there a script around that can do this much faster? If not could you guys help me get this one working?

In case it helps this is what I have atm:
macroScript Macro1
	category:"DragAndDrop"
	toolTip:""
(
	modPanel.addModToSelection (Edit_Poly ()) ui:on
	actionMan.executeAction 0 "40373"
	max file export selected
	max select
	deleteModifier $ 1
)

Thanks!

Replies

  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    you need to enable quiet mode when you export - here's an example
    
    --hard code paths because I'm a lazy sod...
    exportFolder = "C:\\export_pile"
    exportFileName = ("thing.fbx")
    
    
    -- do some stuff
    
    
    print (exportFolder  + "\\" + exportFileName)
    exportFile ( exportFolder  + "\\" + exportFileName) #noPrompt quiet:true    
    
    
  • CastorPT
    Options
    Offline / Send Message
    CastorPT polycounter lvl 9
    Thanks for the help.Is it supposed to look like this then?

    (
    		--hard code paths because I'm a lazy sod...
    exportFolder = "C:\Dropbox\raw_data\misc"
    exportFileName = ("temp.fbx")
    
    	modPanel.addModToSelection (Edit_Poly ()) ui:on
    	actionMan.executeAction 0 "40373"
    	max file export selected
    	max select
    	deleteModifier $ 1
    
    print (exportFolder  + "\\" + exportFileName)
    exportFile ( exportFolder  + "\\" + exportFileName) #noPrompt quiet:true
    	
    
    )
    

    I still get the pop up to ask for the folder...like I said, my maxsscript skills are null...
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    you appear to be exporting it twice


    lose the "max file export selected" line and see what happens
  • CastorPT
    Options
    Offline / Send Message
    CastorPT polycounter lvl 9
    Ok, this is what I got so far. Those 2 lines are the actual export process?
    (
    			--hard code paths because I'm a lazy sod...
    			exportFolder = "C:\Dropbox\raw_data\misc"
    			exportFileName = ("temp.fbx")
    			
    			-- Add "Edit Poly" modifier to selection
    			modPanel.addModToSelection (Edit_Poly ()) ui:on
    			
    			-- Export Selected
    			print (exportFolder  + "\\" + exportFileName)
    			exportFile ( exportFolder  + "\\" + exportFileName) #noPrompt quiet:true
    
    			-- Remove "Edit poly"
    			deleteModifier $ 1
    )
    
  • CastorPT
    Options
    Offline / Send Message
    CastorPT polycounter lvl 9
    And this is what I get in the listener with the Print command...I wonder if there is something wrong with the way I wrote the folders?
    "C:\Dropbox
    aw_data\misc\temp.fbx"
    
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    you need to escape the backslashes by using a double backslash instad of a single

    eg.
    "c:\\dropbox\\aw_data\\misc\\temp.fbx"
    

    and yeah - this line does the export. I cant remember if it'll export the whole scene or the selected object(s) off the top of my head - you'll be able to check in the maxscript help to find out for sure.
    exportFile ( exportFolder  + "\\" + exportFileName) #noPrompt quiet:true
    
  • Eric Chadwick
    Options
    Offline / Send Message
    For vertex blend shaders, take a look here.
    http://wiki.polycount.com/CategoryShaders

    Shader FX is the easiest way to get a simple vertex blend shader. They have sample shaders, but you can also very easily make one too. Free for individuals IIRC.
  • CastorPT
    Options
    Offline / Send Message
    CastorPT polycounter lvl 9
    Thanks for the tip, trying that right now.
    As for the Maxscript...I feel so lost, I still cant get it to work and it seems I have to restart max everytime I want to see it run with the new changes, it takes ages to try it out.

    I'm not a technical artist and just wanted to have a quick go at doing something that would save me tons of time but its taking a lot longer than I wanted...

    This is what I have so far, not sure why its not exporting
    macroScript Macro1
    	category:"DragAndDrop"
    	toolTip:"Export to FBX"
    (
    		--hard code paths...
    		exportFolder = "C:\Dropbox\raw_data\misc"
    		exportFileName = ("temp.fbx")
    		
    		-- Add "Edit Poly" modifier to selection
    		modPanel.addModToSelection (Edit_Poly ()) ui:on
    		
    		-- Export Selected
    		print (exportFolder  + "\\" + exportFileName)
    		exportFile ( exportFolder  + "\\" + exportFileName) #noPrompt quiet:true
    		
    		-- Remove "Edit poly"
    		deleteModifier $ 1
    )
    
  • CastorPT
    Options
    Offline / Send Message
    CastorPT polycounter lvl 9
    A friend just told me that I need double backslash for folder, that was the problem!
    The script is now exporting but not the selected objects.. it exports everything... any help on that part?
    (
    		--hard code paths...
    		exportFolder = "C:\\Dropbox\\raw_data\\misc"
    		exportFileName = ("temp.fbx")
    		
    		-- Add "Edit Poly" modifier to selection
    		modPanel.addModToSelection (Edit_Poly ()) ui:on
    		
    		-- Export Selected
    		print (exportFolder  + "\\" + exportFileName)
    		exportFile ( exportFolder  + "\\" + exportFileName) #noPrompt quiet:true
    		
    		-- Remove "Edit poly"
    		deleteModifier $ 1
    )
    
  • CastorPT
    Options
    Offline / Send Message
    CastorPT polycounter lvl 9
    So I finally got it working, for those interested!

    --hard code paths...
    		exportFolder = "C:\\Dropbox\\raw_data\\misc"
    		exportFileName = ("temp.fbx")
    		
    		-- Add "Edit Poly" modifier to selection
    		modPanel.addModToSelection (Edit_Poly ()) ui:on
    		
    		-- Export Selected
    		print (exportFolder  + "\\" + exportFileName)
    		exportFile ( exportFolder  + "\\" + exportFileName) #noPrompt quiet:true selectedOnly:true
    		
    		-- Remove "Edit poly"
    		deleteModifier $ 1
    

    Now for learning shader fx.... any tips on creating the simple black/white vertex colors blend material?
Sign In or Register to comment.