Category Archives: Blog

Vray to Blender PBR/FBX

Im often exporting models from 3dsmax to Blender and this is a fast way to import the models so that the material is automatically converted and imported into Blender with PBR materials applied with correct default settings.

What does it do?

It takes a Vray Material with Roughness workflow, converts it to Standard (Legacy) material and is ready for export to FBX. You can extend on the script or modify it for your needs. This is the workflow:

Blender to GLB/GLTF for real-time:

A secondary benefit to this workflow is that once the file is imported into Blender as FBX it can be directly exported to GLB/GLTF for real-time workflow. If you want to include ambient occlusion you will have to do this manually for now. I might create a script in future, no promises on that one since its usually very simple with two additional nodes in the shader editor as shown in the Blender manual.

Converts:

  • Diffuse texture, Diffuse Color, VrayColor in Diffuse
  • Roughness texture
  • Metal texture
  • Opacity texture
  • Normal texture
  • Normal DirectX to OpenGL (3dsmax uses DirectX & Blender uses OpenGL, its done via naming convention – Optional)
  • Sets the correct Specular level for Blender
  • Sets Reflection to White
  • Sets Dielectric or Metallic material for Blender (depending on if Metal texture is used)
  • Sets Gamma settings for sRGB and Linear images
  • Can convert VrayMtl, Vray2SidedMtl, Multi-Material. You can edit the functions in the script to add more material types if you use them

Export Options in FBX:

Comparisons:

3dsmax Vray Roughess Material:

Standard (Legacy) Material – Converted with Script

Blender Principled BRDF Shader – Imported FBX (Automatic Settings)

3dsmax Script download:

https://github.com/jmdvella/VrayToFBX

3dsmax (.ms) Code:

/*
3dsmax to Blender FBX Material Converter 
jmdvella@gmail.com
2022
*/

macroscript VrayToFBX
	category:"Vella" 
	internalcategory:"Automate"
	tooltip:"Automate VrayToFBX"
	buttonText:"Vray To FBX"
	Icon:#("SchematicView",2)

(
	-- Function to replace Vray with Standard and setup PBR settings for FBX/Blender
	fn convert_to_stdmtl i =
	(
		-- Standard Settings for PBR export
		newMat = Standardmaterial ()
		newMat.name = i.name
		newMat.diffuse = i.diffuse
		newMat.bumpMapAmount = 100
		newMat.specularLevel = 25
		
		-- Replace VrayColor with Standard Diffuse Color
		if (classof i.texmap_diffuse == VrayColor) then
		(
			newMat.diffuse = i.texmap_diffuse.color
		)
		else
		-- Replace Diffuse texture with node in Diffuse slot
		(
			if i.texmap_diffuse != undefined then
			newMat.diffusemap = i.texmap_diffuse
		)
		
		-- Replace Roughness texture
		if i.texmap_reflectionGlossiness != undefined then
		(
			newMat.glossinessMap = i.texmap_reflectionGlossiness
		)
		
		-- Replace Metal texture
		if i.texmap_metalness == undefined then
		(
			newMat.reflectionMapEnable = on
			newMat.reflectionMapAmount = 0
		)
		else
		(
			newMat.reflectionMapEnable = on
			newMat.reflectionMap = i.texmap_metalness
		)
		
		-- Replace Opacity
		if i.texmap_opacity != undefined then
		(
			newMat.opacityMap = i.texmap_opacity
		)
		
		-- Replace Normal texture
		if i.texmap_bump != undefined then
		(
			newMat.bumpMap = i.texmap_bump.normal_map
		)
		
		-- Convert DirectX Normal texture to OpenGL (Optional) 	<--------------
		if i.texmap_bump != undefined then
		(
			i.texmap_bump.normal_map.filename = substituteString i.texmap_bump.normal_map.filename "DirectX" "OpenGL"
		)
		
		-- Convert Vray to Standard Mtl
		i = newMat

	)
	
	-- Function to replace VRay2SidedMtl with VrayMtl
	fn convert_Vray2Sided_to_VrayMtl i = 
	(
		newMat = i.frontMtl 
		
		-- Convert Vray to VrayMtl
		i = newMat
		
		-- Convert from VrayMtl to StandardMtl using convert_to_stdmtl Function
		convert_to_stdmtl i
	)
	
	-- Find all VRay2SidedMtl and replace with VrayMtl in the scene
	for i in sceneMaterials do
	(
		if (classof i == VRay2SidedMtl) do
		(
			p = convert_Vray2Sided_to_VrayMtl i
			
			if (i.name == p.name) and (i.name != undefined) do
			(
				replaceinstances i p
			)
		)
	)		
	
	-- Find all VrayMtls and VrayMtls in Multi-Sub in the scene
	for i in sceneMaterials do
	(
		-- Convert VrayMtl to StandardMtl using convert_to_stdmtl function
		if (classof i == VrayMtl) do 
		(
			p = convert_to_stdmtl i
			
			if (i.name == p.name) and (i.name != undefined) do
			(
				replaceinstances i p
			)
			
		)
		
		-- Find Multi-Sub Materials
		if (classof i == Multimaterial) do 
		(
			-- Convert VrayMtl to StandardMtl using convert_to_stdmtl function
			for n in i do
			(
				if (classof n == VrayMtl) do 
				(
					p = convert_to_stdmtl n
					
					if (n.name == p.name) and (n.name != undefined) do
					(
						replaceInstances n p
					)
					
				)	
			) 
		)
	)
			
	-- refresh asset tracker
	ATSOps.Refresh()
)

Corona vs Vray

I have finally had a little R&D time at work and decided to see what all the hype was about on Cgpress about the Corona update… I have to say Im quite impressed. (I havent looked at Corona since 0.6)

I converted a scene using the built in converter (piece of cake), adjusted the vegetation materials exactly as Juraj explains here Corona Forum and then hit render. Wow, I think ill be looking into this a little more!

These are just raw renders – no post production applied.

Corona

Vray

Evermotion Test Scene 

Corona

Vray

Brisbane Residential Dwellings

Another great project to work on recently with a close work colleage. We had a short time to deliver however it all worked out in the end and I was lucky again to have a bit of free rain over the lighting, materials and vegetation to match the existing environment. The dwelling colours and Poinciana tree (red tree to the right) were apart of the schedule however 🙂

Disney

I got to work on some mobile wallpapers and interactive media for Disney Japan. Very lucky to work on this project and a joy to work with Disney!

Polly Pocket

I have been working on a kids cartoon called Polly Pocket by Mattel. These were the Sets that I got to create from storyboard & concept art provided. This has been a great project to work on over the years and the professionals I get to work with are some of the most creative people I have met. Ignore the scary dolls with no eyes they are there for scale 🙂

Graphic Design: Brett Lee Cricket Trainer

Illustrator, Photoshop & 3D Studio Max

2012

Client – World Sport International

These are the contents produced for the Brett Lee Cricket Trainer. The first 3 images are concept images of the box when wrapped, then an image showing the layout of how the box is produced from Illustrator. Then some additional images to show the instructions, the container for the ball (the oval shaped image) and then finally some logo designs I produced for the product.

As a side note this should be available on the shelves 2013 I will be updating this when its available to the public.