Corona Renderer Forum

General Category => Porting and API => Corona for Blender => Topic started by: burnin on 2016-10-20, 01:46:16

Title: [solved] blender exporter & an older scene
Post by: burnin on 2016-10-20, 01:46:16
Am doing a revision on an exemplary test scene provided by chocofur.com (http://www.chocofur.com/) to be concurrent with latest releases (Blender, Corona SA) but have stumbled upon a deal breaker. Doesn't render, tho with Material Override it does.

Error:

Code: [Select]
Traceback (most recent call last):
  File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\engine.py", line 353, in render
    render_start( self, scene)
  File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\engine.py", line 38, in render_start
    render_scene( engine, scene)
  File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\engine.py", line 189, in render_scene
    bpy.ops.corona.export_mat()
  File "C:\Programs\b278\2.78\scripts\modules\bpy\ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
  File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\operators\export.py", line 117, in execute
    write_mtl( root, default_mat, mat, None, mtl_mat_name, True)
  File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\outputs.py", line 233, in write_mtl
    addTexture(xml_col, crn_map.map_ke)
NameError: name 'crn_map' is not defined

location: C:\Programs\b278\2.78\scripts\modules\bpy\ops.py:189



location: <unknown location>:-1


Any help appreciated...


source:   
Corona & Blender (Setting & Rendering with Corona) (http://www.chocofur.com/corona--blender.html)

         
Title: Re: [bug] exporter - material bug?
Post by: burnin on 2016-10-21, 05:33:06
No worry, don't hurry... ;) Guess it doesn't matter anymore.
So since i couldn't find a culprit, have decided to just go through the whole thing.
... re-do to fit the present situation.

Tho if anyone's got a clue, i'd be happy to know

bye bye
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-10-24, 00:49:03
It is more of a change in the Blender API rather than a bug I think (scene is done in Blender 2.72 compared to the new version 2.78.
A lot of update need to be done in the corona blender integration, one is the material and the other one is ies support.Update also to Corona standalone
had bring this new "bug" as you call it.

Though the blender exporter is working when you do a new scene in Blender 2.78, but not in an old scene. ;)
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: burnin on 2016-10-24, 03:43:37
Hi,
Yes, had suspected same as you note, as i tried to get something viable with it.
Got IES disabled & found the other missing feature that's causing error in this case - textures on emitters.
Also there are no light/emission material nodes and lots more to do.

Am checking & correcting this scene as is ready & freely available, to give back in hope there will be some more exposure, help and testing on the way. Since things are going slow on the front, yet do look promising.
As there's no IPR in SA, got set @24 samples + pinch of denoise. Fast preview...
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-10-26, 07:42:46
Hi @burnin,

Apologies I have only just seen this now.  I have created an issue and provided a fix https://bitbucket.org/coronablender/render_corona/issues/34/crn_map-material-bug

Thanks for reporting!

Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: burnin on 2016-10-27, 17:02:19
Hi, no problem... thanks for looking into it. I really appreciate your work.

I also noticed that corona node trees are not connected (selected) along with Material selected in Properties.
i.e. If a material that has node tree assigned is selected, user has to find&select that node tree in the Node editor also for further manipulation... making it easy & prone to human mistakes (by editing different node tree) if not being extra careful. Also renaming a tree disconnects it from the material.
With huge material list, this soon becomes very distracting & counterproductive.
Is it by design? If anything can be done about it would be more than welcome, thinking it's a big turnoff for starters.
While in LuxRender & RenderMan nodetree selection works per material selected.

Thanks again for everything
:)
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-10-31, 02:24:44
Yep good point, created issue https://bitbucket.org/coronablender/render_corona/issues/35/synchronize-selected-node-editor-with to track this.

Thanks
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-11-05, 05:16:44
Hi @blanchg

Reflection is not updating correctly as you can see from the image below.
When I increase fresnel value then reflection shows.
Is this suppose to be the correct reflection behavior?...or need to fix it in the exporter?

Thank you.

Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-11-06, 22:15:27
I believe that is the behavior of Corona.  The chocofur website has some amazing material content http://www.chocofur.com/5-materials.html with some solid base material types that work great with Corona
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-11-06, 22:21:06
I just found this handy chart

https://macdesignstudio.files.wordpress.com/2012/01/fresnel-ior_reflection-glossiness-matrix.jpg

Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-11-07, 01:56:22
Thanks for that references that follows major rendering engines.
What I am actually looking for is that when you adjust reflection value
without touching fresnel you can already see a default sheen that the material
is reflecting.

Of couse fresnel is just going to kick in when you increase or lower its value.
Hope it makes sense. Not really a major thing.

Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-11-07, 21:50:20
Do you mean the default reflection Fresnel value should be higher so that you can see the reflection immediately?
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-11-08, 00:47:33
Do you mean the default reflection Fresnel value should be higher so that you can see the reflection immediately?

Ok I got it, we are using a general CoronaMtl here that is why all the values are default to diffuse material.
To get glossy, glass, etc one need to key-in all the values that corresponds to material type.

Sorry for that. Preset will be helpful specially that there is no documentation at the moment (feature request).
Thanks.



Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-11-10, 13:11:27
Yes exactly, apologies,  Having some sample materials was one of the first things I identified as needing attention (https://bitbucket.org/coronablender/render_corona/issues/4 (https://bitbucket.org/coronablender/render_corona/issues/4)), though getting all the features working first has taken priority.

The creator of chocofur has kindly given me permission to include some of his base material setups in the exporter, that should happen fairly soon.
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-11-11, 08:40:28
That will be great!

Well understood if you are following a roadmap.
We can wait for certain feature integration.

At the moment we will play around with the latest update.
Thanks....
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-11-12, 02:43:12
Corona Blender  rocks!
Just some few items to mention.
1. emission texture is not working. Should this be show in the coronamtl properties or coronalight properties?
2. Ray Invisibility is missing or disabled. Previously this is working.
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-11-12, 13:14:17
Excellent tests.

The node versions of the materials are much more tested usually but I will fix any issues you find asap. 

Ray invisibility will be removed from the simple material panel as it can't be easily supported there.  It is supported through the node tree.

Keep the issues coming
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-11-12, 13:41:11
I will take a look at the material node system again, I was trying to enable it but could not
find the material node system or could not enable it? Any idea?
When I click node material at material properties, it does not shown inside node viewport.
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-11-12, 13:45:13
Click the add material node tree button and on another view set it to the node editor. Then there are three buttons on the node editors toolbar to choose the texture icon. I can't send a screenshot right now but maybe tomorrow.
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-11-12, 13:48:12
Oh my, I did not try to click the texture icon coz I was looking for the material icon.
Thanks.

But here is what I've got!

Material node is working perfectly.....
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: jKLman on 2016-11-15, 00:14:12
@blanchg

You really did a great job in updating Blender integration with Corona.
After trying testing the old chocofur file WITHOUT touching or updating any object to the latest exporter, ie material, maps, texture etc,
it just did work! No crashes and any errors in the Blender console.

Though there are few changes or that are not compatible maybe with the new Corona Standalone that did not render correctly but the exporter is almost backward compatible with what Joel has greatly done and shared with us.

Here is the test.

Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: blanchg on 2016-11-15, 00:19:11
@jKLman, thanks, I did build on the awesome work that Joel did and tried to keep the changes to a minimum where possible.

There were lots of changes to the material definitions so not surprised that some features didn't make it across to the newer versions of Corona.

That is a great scene and the chocofur website has some great information on working with corona and blender.
Title: Re: [bug] blender exporter & an older scene - material bug?
Post by: burnin on 2016-11-16, 16:18:21
Ohhh, great results and It's all working out-of-the-box now.
Thanks for everything.