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.
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.
First part is solved.
Just change line 123 to:
Scale_value = str(textu.norfac)
Now it can export Scale parameter of bump maps.
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!
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:
in place of "modifier mod_name"
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).
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. :(
Great work, thanks for these updates.
I will try to merge them into the main exporter soon.
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:
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.
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.
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:
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.
p.s. after this little problem, if something's not working (bumps), please say it.
p.s.2 - Christopher Kulla, i love your Renderer. :)
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.
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.
Forgot what i've said. You're right.
I'm going to change the script.
Here it is the correct (i think) bump and normal maps exporter. Please, test it.
p.s. - this way no complicated function needs to be written. :)
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:
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! :) :)
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.
Forgot to say, fpsunflower, can you go to check your Blenderartists private messages, please?
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.
Remove 2 stupid bugs and merge my part with Eugene's part.
Eugene, i hope you don't mind.
@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 :?
If not asking to much, can you post your .SC file (not the GEO.SC)?
I think i got the bug,
can you change in line 238 the word "shiny" to "diffuse" and see if still gives the error?
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.