Little improv in Blender Exporter. help need

MADcello
2007-02-06
2013-05-28
1 2 3 > >> (Page 1 of 3)
  • MADcello

    MADcello - 2007-02-06

    I've made a little improvement in the Blender exporter to export Bump maps and Normal maps.

    But it's not complete. I don't know how to get the "Nor" value in Blender "Map to" texture pannel, so there's a variable waiting to get that value.

    Also, with meshes with more than 1 material, i cannot "say" wich faces use wich Modifier and the faces that have none.

    I'm a noob at Python, but i think half the job is done.

    If someone with more experience can give the last touches, it will be good.

    http://uploader.polorix.net//files/134/sunflow_export_modified.zip

     
    • MartinL

      MartinL - 2007-02-06

      I'm just a blender user and wanted to thank you for your collaboration. I think this is a great software and would love to see it working hand by hand with Blender.

      EzPl.

       
    • MADcello

      MADcello - 2007-02-06

      First part is solved.
      Just change line 123 to:

      ###
      Scale_value = str(textu.norfac)
      ###

      Now it can export Scale parameter of bump maps.

       
    • MADcello

      MADcello - 2007-02-06

      Sorry, it's my first day trying to quit smoking, maybe i get over excited!

      The correct line 123 is:

      Scale_value = str(textu.norfac * textu.mtNor)

      This way, if you have (Nor On) or (Nor On Inverse) or (Nor Off), it is reflected in the Scale value!

      Going to try to solve the multi-materials modifiers problem now!

       
      • Christopher Kulla

        Cool! Thanks for those improvements, I will try to merge them as soon as possible.

        Modifiers should follow the same indexing that is possible for multiple shaders on one mesh. The syntax is the same too:

        modifiers <n>
           mod_name_1
           mod_name_2
        ...

        in place of "modifier mod_name"

         
    • MADcello

      MADcello - 2007-02-07

      I've updated the above link with the things i could made.

      In files ".geo.sc" the modifiers list is written,

      the only thing i could not complete was the function that writes what modifier each face uses, like this (sorry, i just code once in a while).

      SC code:

      face_modifiers
      1
      1
      1
      1
      None
      None
      None
      None
      0
      0
      0
      0

       
    • MADcello

      MADcello - 2007-02-08

      What a mess, i've uploaded the new file with the same name as the old one and the server didn't replace them.
      Here it is the one that only miss the above mencioned function. :(

      http://uploader.polorix.net//files/134/sunflow_export_modified2.zip

       
      • Christopher Kulla

        Great work, thanks for these updates.

        I will try to merge them into the main exporter soon.

         
    • Eugene

      Eugene - 2007-02-09

      Since we're talking about Blender Exporter improvements, I've done a bit of my own.  At this point, it isn't very elegant (I'm in the process of cleaning things up) but a few things have been done to my version:

      1)  Added a caustics/gi section so you can set them in Blender and export the values.
      2)  Added an sfward shader export (though the rough values exported out are hard coded).
      3)  Corrected the mis-spell of the global value "OCCLUSION."

      If you're interested, you can find it here:

      http://www.geneome.net/blender/blenderfiles/scripts/sunflow_export-ETR.py

       
    • Eugene

      Eugene - 2007-02-09

      Oh yeah,

      I was thinking that you might want to change the version numbering of the Blender script to not match the version of Sunflow.  That way, you can update all you want and no one would get confused that the exporter version is slightly different from the Sunflow version.

       
    • Alvaro F. Celis

      Alvaro F. Celis - 2007-02-09

      great work you guys are doing here! I agree with Eugene on the versioning. Then Chris can look into each code and merge the best updates  ;)

      Thanks for the mods, trying them out now.

      Regards,
      Alvaro

       
    • MADcello

      MADcello - 2007-02-10

      I think i've all the things working, but there's a warning from Sunflow that makes me think that one function in  Sunflow is not yet implemented, let me explain:

      SC code:

          face_shaders
              0
              0
              2
              2
              1
              1
              0
              0
              0
              0
              1
              1
          face_modifiers
              0
              0
              None
              None
              1
              1
              0
              0
              0
              0
              1
              1
      }

      First part is Shaders index for multi-material meshes, so i write a function that write Modifier index.
      Am i losing something, maybe the "face_modifiers" tag is wrong?

      fpsunflower, please enlighten me with this doubt.

      Anyway, here it is the Bump version 01.

      http://uploader.polorix.net//files/134/sunflow_export_BUMP_01.zip

      p.s. after this little problem, if something's not working (bumps), please say it.

      p.s.2 - Christopher Kulla, i love your Renderer. :)

       
      • Christopher Kulla

        You are right, face_modifiers isn't implemented. Sunflow simply uses the face_shaders index to look up modifiers. So the modifiers should be specified in the same order as the shaders they correspond to.

        If this isn't convenient I suppose I could add what you described.

         
    • MADcello

      MADcello - 2007-02-10

      I think that's more logical that diferent shaders can use the same mofidier (like the above code).
      And how could you describe a shader without modifier? A "None" modifier in list?

      I've asked you in another thread if it's possible to put a modifier inside a shader and you answer that you've prefered to implement them as separate entities.

       
    • MADcello

      MADcello - 2007-02-10

      Forgot what i've said. You're right.
      I'm going to change the script.

       
    • MADcello

      MADcello - 2007-02-10

      Here it is the correct (i think) bump and normal maps exporter. Please, test it.

      http://uploader.polorix.net//files/134/sunflow_export_BUMP_01_correct.zip

      p.s. - this way no complicated function needs to be written. :)

       
    • Eugene

      Eugene - 2007-02-10

      I cleaned up my updates.  I added comments to where I added stuff with ### ETR ADDITIONS and ### END ETR ADDITIONS.  I also made the photon maps a menu list rather than the hard coded kd or grid since global photons can use both kd and grid.  The menu list for caustics only has kd (since caustics seems to only be able to use kd, but I think keeping it a list is good since if more mapping techniques are added to Sunflow later, it would be a simple thing to add it to the exporter.  I overwrote my previous version:

      http://www.geneome.net/blender/blenderfiles/scripts/sunflow_export-ETR.py

       
    • MADcello

      MADcello - 2007-02-10

      :) Cool!

      As soon as i get mine ready, i'll post it here also.
      I don't want to make a merged version, because many times i forget more things that i want to and i don't want to destroy, instead of build.

      I also go to send fpsunflower the ODT version of a doc i'm writing with some info about the exporter, but, as the original is not mine, fpsunflower will know what to do, better than me.

      This is taking shape! :) :)

       
    • MADcello

      MADcello - 2007-02-10

      Here it is a new Bump version. Also added Constant shader and merged Ward shader from Eugene. (and thank you very much hayfever, for this wonderfull script).

      Now all the shaders are set (some more complete than others).

      I've made some modifications to the way we define shaders just to help with consistency. Now if we want a shader to be diffuse we start the materials name by "sfdiffuse", shiny -> "sfshiny", etc..

      If we want a Mirror shader, we start the name with "sfmirror" and turn ON "Ray mirror".
      If we want a Glass shader, we start the name with "sfglass" and turn ON "Ray transp".

      Hope it help's.

      http://uploader.polorix.net//files/134/sunflow_export_BUMP_02.zip

       
    • MADcello

      MADcello - 2007-02-10

      Forgot to say, fpsunflower, can you go to check your Blenderartists private messages, please?

       
      • Christopher Kulla

        I got your document. Thanks for the tip, my email notification seems to have gotten turned off on that forum.

        I will merge the exporter mods as soon as possible.

         
    • MADcello

      MADcello - 2007-02-11

      Remove 2 stupid bugs and merge my part with Eugene's part.
      Eugene, i hope you don't mind.

      Merged version:
      http://uploader.polorix.net//files/134/sunflow_export_merged_01.zip

       
    • Alvaro F. Celis

      Alvaro F. Celis - 2007-02-11

      @Pacaeiro: when using your merged script to export I get the following error when loading the scene in sunflow:
      Error-API "Expecting type found texture"

      Yet if I use Eugene´s ETR (which is similar) the scene laods and renders fine :?

       
    • MADcello

      MADcello - 2007-02-11

      If not asking to much, can you post your .SC file (not the GEO.SC)?

       
    • MADcello

      MADcello - 2007-02-11

      I think i got the bug,
      can you change in line 238 the word "shiny" to "diffuse" and see if still gives the error?

       
1 2 3 > >> (Page 1 of 3)

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks