My experiment full Scene Interchange 3ds max

this my alpha experiment plugin for import in Blender 2.5.2 full scene , geometry uv, material , texture, lights , animation of camera, and simplex animation of geometry with father children object, plugin for blender is opensource downloadable with encrypted script for 3d studio max,
next time I think also interchange viceversa Blender scene to 3ds Max, Lightwave, Maya
I extended parameter in obj export able for light and animation

plugin Blender 2.5.2 Import

blender2.5.2/.blender/scripts/io
http://www.rendering3d.net/sharing/scene_interchange.py

this native on LINUX , work also windows but not testing

script export for 3d studio max for 3ds max 8 , 9 , 2010
http://www.rendering3d.net/sharing/blender_INTERCHANGE_ALPHA_2010.zip

the video demonstration work also animation Father Children Parent

http://www.youtube.com/watch?v=pLsMzmaH05g

bugfix or changes history

25/04/2010

spot and directional light rotation fixed precision (tnk SterlingY for bug report)
spot and directional light rotation input data in degree
area light shape rectangle fixed

http://www.rendering3d.net/files/scene_interchange%282%29.jpg

Specification my implementation in obj import export

eventually people programmer wants collaborate me in lightwave or maya export
(because perhaps I will begin much time for lightwave or maya, I have other priority plugin)
this is specification for export full parameter to Blender interchange

specification MATERIAL SHADER

newmtl = material name

ka = ambient color
km = mirror color
kd = diffuse color
ks = specular color
ns = specular hardness

ray_reflect = mirror factor 0 to 1
reflect_blur = max blur 0 min blur 1
reflect_samples
reflect_depth = recursive bunch (in some softare in general setting)
reflect_maxdist
reflect_anisotropic
ray_refract = transparency factor 0 to 1
ni = IOR or ETA refractive
refract_blur = max blur 0 min blur 1
refract_samples
refract_depth = quantity levels of refractive with IOR or ETA > 1
refract_limit = distance fallof transparency
translucency = translucency factor
emit = self illumination
sss_scale
sss_color
shader = LAMBERT , OREN-NAYAR
roughness

d = texture use only for alpha channel
map_ka = texture ambient
map_ks = texture specular
map_kd = texture diffuse
map_bump = texture normal bumb
map_d = texture displacement
refl = environment

mapping 1 2 3 4 5 6 7 8 9 10

  mapping texture array sequence

   1 2 3 4 5 6 7 8 9 10

      mapping_clip = map[1]      = image repeat  0 off  1 on
      mapping_mirX = map[2]       = repeat with mirror in x   0 off 1 on
      mapping_mirY = map[3]
      mapping_tX = map[4]        = translate position x
      mapping_tY = map[5]
      mapping_sX = map[6]       = scale X   (or invert value of number of repeat)
      mapping_sY = map[7]
      mapping_flipXY = map[7]       = if repeat x and y is negative   0 off 1 on  (0 default)
      img_h = map[8]               = see texture in viewport 0 off 1 on
      img_alpha = map[9]         = use alpha channel
      img_alpha_neg = map[10]    = invert alpha channel

example:

newmtl Mat1
Ka 0.984314 0.223529 0.258824
Kd 0.984314 0.223529 0.258824
Ks 0.9 0.9 0.9
Ke 0.9 0.9 0.9
reflect_blur 1
refract_blur 1
ray_reflect 0
ray_refract 0
dist_reflect 90000000
dist_refract 90000000
samples_reflect 0
samples_refract 0
l_tr 0.0
selfil 0.0
map_Kd ImagesImmagine_022.jpg
mapping 1 0 0 0.5 1.5 2 2 0 1 1 0
map_bump ImagesImmagine_022.jpg
mapping 1 0 0 0.5 1.5 2 2 0 1 1 0

specification LIGHT

newlight Lampadario01
type OMNI = OMNI SPOT SUN AREA
color 0.984314 0.223529 0.258824
power 1
from 0.0 0.0 0.0
rot 0.0 0.0 0.0 dregree
shadow 1 = 1 raytrace, 0 shadowmap
softshadow 0.5 = size of soft shadows
samples 8
areaX 1.5
areaY 2.5
decay LINEAR = LINEAR,COSTANT,SQUARE
shadowON 1 = 0 off 1 on
specular 1
diffuse 1
fallof 1000 = max distance fallof 0 for off distance
texture Imagelam.ies = texture image or ies file

specification PIVOT

newpivot objname x y z

specification PARENT CHILD OF

newchildof objChildOfName x y z objFatherName
1 2 3 4 5 6

  1. key word
  2. name child object
  3. x pivot child object
  4. y pivot child object
  5. z pivot child object
  6. name Father object

specification CAMERA

newcam Camera01
type PERSPECTIVE = PERSPECTIVE, ORTHOGRAPHIC
from 0.0 0.0 0.0 = view point x y z (z world up)
rot 90 0.0 0.0 = rotation euler deg x y z (z world up)
lensM 50 = lens mm optional
lensD 34 = lens degree optional
lensR 0.87 = lens radiants optional


specification CAMERA MOTION BOUJU

file name same name of camera extension .cam
es

Camera01.cam

cRio Camera01 25 640 480 1.33333 1.0 1.41732 1.06299 1.0 z xyz
0.0 -134.539 -91.5129 26.5867 89.4335 0.0 -50.3759 17.2941 85.5483 69.5119
1.0 -134.471 -91.5129 26.5867 89.4333 0.0142631 -50.3557 17.2989 85.5323 69.4969
2.0 -134.269 -91.5129 26.5867 89.4328 0.0559649 -50.2957 17.3133 85.4849 69.4524

expelling head line:
cRio Camera01 25 640 480 1.33333 1.0 1.41732 1.06299 1.0 z xyz
1 2 3 4 5 6 7 8 9 10 11 12

1 cRio) type data is camera rotation
2) name of camera
3) framerate
4) render whith
5) render height
6) aspect ratio
11 z) axis up
12 xyz) axis

expelling all line:
0.0 -134.539 -91.5129 26.5867 89.4335 0.0 -50.3759 17.2941 85.5483 69.5119
1 2 3 4 5 6 7 8 9 10

  1. frame
  2. pos x
  3. pos y
  4. pos z
  5. rot x
  6. rot y
  7. rot z
  8. lens
  9. lens angle w
  10. lens angle h

specification OBJECT MOTION (my format)

name file same object name extension .mot

frame posx posy posz rotx roty rotz sx sy sz
1 2 3 4 5 6 7 8 9 10

  1. number frame (integer)
  2. position x (float)
  3. position y (float)
  4. position z (float)
  5. rotation eulangle degree x (float)
  6. rotation eulangle degree y (float)
  7. rotation eulangle degree z (float) respect blender vertical axis of the world
  8. scale x (float)
  9. scale x (float)
  10. scale z (float)

I don’t get it, you updated the obj import script or something?

This looks great!

my system import full scene , all parameters material also mentalray , all type lights, camera, animation of camera and simpex animation geometry move, rotate, scale, and parent

i making for 3ds max to blender

the system is very easy also for upgrade obj export maya and lightwave
but perhaps I not have time

Why not just extend the material support in collada?

collada already full solution for exchange each thing … :smiley:
and I think not necessary of have implemented the perfect system…

but somebody prefers obj… :wink:

Thanks Silvio! Now You’re scary! :slight_smile: so much coding in so little time. Please rest your eyes! I’ll start testing for windows and report here ASAP

Michael W, You’re right that collada or FBX would have meant starting from something instead of zero, but I am glad that yet another route exists, as it will only provide us with more choice and flexibility.

Well, material support is extremely basic with collada in blender… though the format can allow much much more interoperability…

but somebody prefers obj… :wink:

Do you export an obj per uvset and then merge data on import?

I tested your script on Windows 32 bits with max 2010 and Blender 2.5.alpha2 official, and it works! (very fast) Here are some remarks of my first test on static cubes and teapot:
-It’s as if it made objects at their right position with centers at 0, 0, 0, and then move them by center to coordinates of their original max pivot points, which actually doubles their position offset to the origin. Using AltG solves the offset but pivot points are then at the origin.
-It creates keys even if there isn’t any animation in the original scene,
-It seems to apply smooth shading by default
-It collapses turbosmooth into the mesh, having a subsurf modifier would be nice.

Any chance you could provide the MS file instead of an MSE? I would like to see how the maxscript is working as well.

MSE is encrypt file not possible modify, but I promise
I am improving this maxscript and sharing better maxscript in this month

if anybody has demands greater than implement as regards what I have thought am useful in my script I imagines be a big firm, and if possible wants to have this small possibility of enter a collaborate in big and serious group in CG outside Italy
(after my 15 years of CG for italians I know too well the dramatic situation in Italy)
I khon also lightwave scrips and Maya mel

ps.
For Blender python I happy sharing all my scripts because Blender is open Source!
also for Blender community that more available to collaborate

OBJ format for many years has not changed, all Software 3d
have good OBJ import / export
OBJ format is very easy not uses xml or other similar superfluous complication…

my system is easy not change the format of OBJ geometry,
the easy solution is not use is .mtl file and use other file have more parametes

other format changed too much times…

in maxscript export have BUG
for 3ds max 2010 is OK

but in 3ds max 9
writen one shader world same material and blender import stopped for ‘UNDEFINED’ parameters

Do you really need to support max 9 ?

the problem was not not even for a difference max2010 / max2009
the problem caused a some plugin of third party in one special shade world not for geometry

today I replaced new 3ds max export now have filter passed only shader geometry and plugin third party not interfere
I think it work also max 8 and 9 but not testing

and adding other paramters for crooping texture and more

Thank you alot for your effort !

One question:
-Would it be possible to export models from 3ds max with v-ray materials into blender to render them in blender with the full integrated v-ray renderer in 2.5 from andrey ? See here http://vray.cgdo.ru/forum/viewtopic.php?f=10&t=332&sid=e55124ad1d44a551412b975c611d45a4

Kind regards
Alain

Well I wanted to ask this, too :). Would be very nice to have this, too :slight_smile:

maces

Silvio,

I tried your amazing script with MAX 2010, and I came a cross a problem with spot lights.

In MAX I had created a target spot light. If the light is pointing straight down, then things are fine, but if it is off axis, for example, the target is at (0,0,0) and the light is at (200,0,200), then the imported scene does not match. I am not sure where the error occurs, export or import.

What I can tell you is that the angle of the light in Blender is smaller than in MAX

you can see what I am talking about in this images:

blender: http://www.pasteall.org/pic/show.php?id=2907

max: http://www.pasteall.org/pic/show.php?id=2908

-Sterling

yes next time I finish and publish new max export able to export from 3ds max with v-ray materials and cebas finalrender material into blender material, for external rendering engine see yafaray …

thank you for report bug, I have not had much time of try it because I am realizing a series of scripts in the same time, I try to complete and improve all my script before of stable Blender 2.6