What im working on right now

Discussion related to the exporter plugin for Autodesk 3ds Max.

Moderators: Ratow, hedphelym, coordinators

What im working on right now

Postby PerPixel » Tue Feb 15, 2011 10:36 pm

So this is what I'm working on right now. New core interface for LuxMax and all in script this time. Only the PLY exporter remain in C++ but I have also a maxscript PLY exporter in this for case where the C++ plugin is not compatible or not installed. Right now I do no support any LR material, camera or lights but the great thing about this script is that we wont have to update the core exporter to add support for new features. So here a list of what is working now.

    Geometries (Using wirecolor for object with no material. Other will render grey)
    Perspective view (You basically just add an object and hit render)
    Camera FOV (no DOF yet, I have to figure out how to compute the lensradius first......)
    Omni lights
    If you don't have any light source in the scene it will render with a default sky light
    Environment map EXR (in the 3dsmax render->environment dialog under environment map setting add a bitmap and pick a exr file. This will lite the scene)
    UI very similar to Blender
    Multiple camera support (You can select the camera from the dialog. Doesn't need to be active)

Make sure you set your output path and luxrender path

The next step to this is getting material working. We can make this happen by just Adding a GetLuxRenderString() function to LR Material. Thats function should return a string that can be added to the lxs or lxm file directly. This way we can easily add more materials or light source without adding any code to the core script. This is how that function should look like,

Code: Select all
         function GetLuxRenderString =
         (
            str = stringstream ""
            format "\nVolumeIntegrator \"%\"\n" (GetLuxString "ddl_volume") to:str
            format "\t\"float stepsize\" [%]\n" (GetLuxValue "stepsize") to:str
            return (str as string)
         )
Attachments
Luxmax.zip
(8.17 KiB) Downloaded 121 times
LuxMax.png
PerPixel
Developer
 
Posts: 107
Joined: Fri Jul 03, 2009 7:13 am
Location: Montreal, Canada

Re: What im working on right now

Postby moure » Wed Feb 16, 2011 4:26 am

intergrating the materials wont be a big issue as its only a fn_writeshaders that needs to be called in order to write down the materials.
love the new like blender ui,especially the no need for cameras or the no need for render through cameras.I cant see a material preview tab in your script,but thats not necessary as we plan to intergrate it in the materials menu.
when i get back from university in the evening ill check it out.There is some work to be done,if you have gmail add me and stig to your contacts so that we can make it work.
Great work though!Congratulations :)
User avatar
moure
Developer
 
Posts: 421
Joined: Sun Sep 26, 2010 4:32 am
Location: Greece

Re: What im working on right now

Postby patro » Wed Feb 16, 2011 6:15 am

Hi Perpixel,

thank you for the work ot the new interface and functionality of LuxMax.

when I have a moment I'll try it and report my experience.
I have only a small request related to the camera.
is it possible to have also the one coded by Stig? this mean to have a flag in your script UI where to chose the camera, cause this one is extremely customizable.
thanks for the great job as always :)
User avatar
patro
 
Posts: 1831
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

Re: What im working on right now

Postby PerPixel » Wed Feb 16, 2011 7:33 am

The LR Free will work but we need to clean it up first to keep only LuxRender Camera setting in there.
PerPixel
Developer
 
Posts: 107
Joined: Fri Jul 03, 2009 7:13 am
Location: Montreal, Canada

Re: What im working on right now

Postby PerPixel » Wed Feb 16, 2011 8:01 am

I attached a new script version that support LR materials.

Example of the Matte material support,

Code: Select all
plugin material LuxrenderMatte name:"LR Matte" classID:#(0x61108483, 0x4d218a72) extends:Standard replaceUI:true version:1
(
        --// add this function
   function GetLuxRenderString =
   (
      str = stringstream ""
      format "MakeNamedMaterial \"%\"\n" this.name to:str
      format "\t\"string type\" [\"matte\"]\n" to:str
      format "\t\"color Kd\" [% % %]\n" (this.kdColor / 255).red (this.kdColor / 255).green (this.kdColor / 255).blue to:str
      format "NamedMaterial \"%\"\n" this.name to:str
      return (str as string)
   )
      
   parameters main rollout:params
   (
Attachments
Luxmax.zip
(8.21 KiB) Downloaded 94 times
PerPixel
Developer
 
Posts: 107
Joined: Fri Jul 03, 2009 7:13 am
Location: Montreal, Canada

Re: What im working on right now

Postby patro » Wed Feb 16, 2011 8:29 am

Hi,
I tried the first posted version...
I was curious about the hybrid sppm mode.... as I know sppm isn't integrated at time.
so I tried it... my machine freezed after scene parsing by luxrender.
I also forget to replace materials

I'm trying the new one but I get this error also by had replaced all scene materials by a Lr matte or with a standard one.

unknown propperty: "getluxrenderstring" in textandlines: LR_Matte
User avatar
patro
 
Posts: 1831
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

Re: What im working on right now

Postby PerPixel » Wed Feb 16, 2011 9:00 am

Add a try catch around the material export part in the luxmax.ms

Code: Select all
                  try
                  (
                     --// Write default material if none on the object
                     if (obj.material == undefined) then
                     (
                        format "MakeNamedMaterial \"Wirecolor\"\n" to:f
                        luxWriteString "type" "matte" f
                        luxWriteColor "Kd" (obj.wirecolor / 255) f
                        format "NamedMaterial \"Wirecolor\"\n" to:f
                     )
                     --// Check if its a LuxRender Material
                     else if (obj.material.GetLuxRenderString != undefined) then
                     (
                        print obj
                        format "%" (obj.material.GetLuxRenderString()) to:f
                     )
                  ) catch ()
PerPixel
Developer
 
Posts: 107
Joined: Fri Jul 03, 2009 7:13 am
Location: Montreal, Canada

Re: What im working on right now

Postby patro » Wed Feb 16, 2011 9:38 am

PerPixel wrote:Add a try catch around the material export part in the luxmax.ms

not sure to had understand what to do... but I replaced with notepad++ the upper code with the one in the script...
now the script failt to open
error in line catch
Code: Select all
                  try
                  (
                     --// Write default material if none on the object
                     if (obj.material == undefined) then
                     (
                        format "MakeNamedMaterial \"Wirecolor\"\n" to:f
                        luxWriteString "type" "matte" f
                        luxWriteColor "Kd" (obj.wirecolor / 255) f
                        format "NamedMaterial \"Wirecolor\"\n" to:f
                     )
                     --// Check if its a LuxRender Material
                     else if (obj.material.GetLuxRenderString != undefined) then
                     (
                        print obj
                        format "%" (obj.material.GetLuxRenderString()) to:f
                     )
                  ) catch
              ()
            
            format "\nWorldEnd\n" to:f
            close f
            return true
         )
         catch
         (


the error is at line 684
User avatar
patro
 
Posts: 1831
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

Re: What im working on right now

Postby moure » Wed Feb 16, 2011 10:04 am

sorry perpixel, does your script support the current Lr materials?
User avatar
moure
Developer
 
Posts: 421
Joined: Sun Sep 26, 2010 4:32 am
Location: Greece

Re: What im working on right now

Postby PerPixel » Wed Feb 16, 2011 10:36 am

mourre, yes when we modify all of them to match my requirment. should be very easy.

patro, you almost did it right... ill send you an email.
PerPixel
Developer
 
Posts: 107
Joined: Fri Jul 03, 2009 7:13 am
Location: Montreal, Canada

Next

Return to LuxMax (Autodesk 3Ds Max Exporter)

Who is online

Users browsing this forum: No registered users and 0 guests

cron