Chaos Corona Forum
General Category => Porting and API => Chaos Corona for Blender => Topic started by: Sanekum on 2017-06-14, 17:47:29
-
Hello there.
Can anyone explain me the mechanism of how proxy geometry works in corona blender?
Step by step instruction will be great, i just cant get it works, i get material error during export and render dont start.
-
Have you tired with binary export?
-
Hi there @Sanekum
Can you please provide the system console. In blender Window > Toggle System Console. You can select the text and copy and paste it here.
-
Corona: Bitbucket version 6.0.7
Corona: Starting add-on, version 6.0.7
Adding UI Panel: Corona render settings
Adding UI Panel: camera
Adding UI Panel: material
Adding UI Panel: environment
Adding UI Panel: particle systems
Adding UI Panel: Corona render passes
Adding UI Panel: Corona object properties
Adding UI Panel: lamp
Corona: Add-on started
--------------------------------------------
read blend: D:\Pro\Test\corproxy.blend
Corona: Writing configuration file Scene.conf
Corona: Writing scene file Scene.scn
Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 1148, in write_scn
addMaterials(xml_inst, dupli, mtlfilename, False, crn_scn, mtllib)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 670, in addMaterials
materials = readMaterials(fn)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 655, in readMaterials
with open(mtlfilename, 'r', encoding="utf8") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\Proxy\\Corona\\corproxy.mtlindex'
Corona: Failed :(
Error: Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 1148, in write_scn
addMaterials(xml_inst, dupli, mtlfilename, False, crn_scn, mtllib)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 670, in addMaterials
materials = readMaterials(fn)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 655, in readMaterials
with open(mtlfilename, 'r', encoding="utf8") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\Proxy\\Corona\\corproxy.mtlindex'
Error: Something went wrong, unable to write .scn file. Check directory permissions of export directory.
Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\engine.py", line 482, in render
render_start( self, scene)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\engine.py", line 165, in render_start
render_scene( engine, scene)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\engine.py", line 314, in render_scene
bpy.ops.corona.export_scene()
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\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:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 1148, in write_scn
addMaterials(xml_inst, dupli, mtlfilename, False, crn_scn, mtllib)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 670, in addMaterials
materials = readMaterials(fn)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scripts\addons\coronablender\outputs.py", line 655, in readMaterials
with open(mtlfilename, 'r', encoding="utf8") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\Proxy\\Corona\\corproxy.mtlindex'
Error: Something went wrong, unable to write .scn file. Check directory permissions of export directory.
location: <unknown location>:-1
location: <unknown location>:-1
-
Thanks I will have a look soon
-
First update to v6.0.12+
I found and fixed a few issues with proxy objects today. Not what you are seeing but it might help.
Next, make sure you can render the target proxy object first. It should export a .obj or .cgeo as well as a .mtl file and a .mtlindex.
Then connect it up to your other scene and set the proxy and material.
Let me know how it goes.
-
Thanks @blanchg
Proxy now works perfect except one issue -
I wanted to make instances of my proxy via particle system, made simple setup and got error again during export, only restart and removing particle system object to hidden layer helps
--------------------------------------------
Corona: Bitbucket version 6.0.11
Corona: Starting add-on, version 6.0.11
Adding UI Panel: Corona render settings
Adding UI Panel: camera
Adding UI Panel: material
Adding UI Panel: environment
Adding UI Panel: particle systems
Adding UI Panel: Corona render passes
Adding UI Panel: Corona object properties
Adding UI Panel: lamp
Corona: Add-on started
--------------------------------------------
Running background check for update
Starting background checking thread
BG: Checking for update now in background
Checking for update function
Read in json settings from file
Determined it's time to check for updates
Getting tags from server
read blend: D:\pro\Test\Corona\prox.blend
Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\coronablender\properties\material.py", line 9, in dummyupdate
view3D_mat_update(self, context)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\coronablender\util.py", line 355, in view3D_mat_update
mat = context.object.active_material
AttributeError: 'NoneType' object has no attribute 'active_material'
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\scri
pts\addons\coronablender\properties\material.py", line 7, in dummyupdate
Most recent tag found: {'name': 'Master', 'zipball_url': 'https://api.github.com
/repos/bsavery/PRMan-for-Blender/zipball/master'}
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\py
thon\lib\threading.py", line 914, in _bootstrap_inner
self.run()
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\py
thon\lib\threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\PRMan-for-Blender-master\addon_updater.py", line 1029, in async_che
ck_update
self.check_for_update(now=now)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\PRMan-for-Blender-master\addon_updater.py", line 784, in check_for_
update
self.save_updater_json()
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\PRMan-for-Blender-master\addon_updater.py", line 984, in save_updat
er_json
outf = open(jpath,'w')
PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\Chaos Group\\
Blender 2.78 (With V-Ray Additions)\\2.78\\scripts\\addons\\PRMan-for-Blender-ma
ster\\prman-for-blender-master_updater\\updater_status.json'
Corona: Writing configuration file Scene.conf
Corona: Writing scene file Scene.scn
Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\coronablender\outputs.py", line 1167, in write_scn
mtlfilename = mtllib.replace('.mtl', mtlindex_ext, mtllib)
TypeError: 'str' object cannot be interpreted as an integer
Corona: Failed :(
Error: Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\coronablender\outputs.py", line 1167, in write_scn
mtlfilename = mtllib.replace('.mtl', mtlindex_ext, mtllib)
TypeError: 'str' object cannot be interpreted as an integer
Error: Something went wrong, unable to write .scn file. Check directory permissi
ons of export directory.
Traceback (most recent call last):
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\coronablender\engine.py", line 490, in render
render_start( self, scene)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\coronablender\engine.py", line 173, in render_start
render_scene( engine, scene)
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\coronablender\engine.py", line 322, in render_scene
bpy.ops.corona.export_scene()
File "C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\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:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Additions)\2.78\sc
ripts\addons\coronablender\outputs.py", line 1167, in write_scn
mtlfilename = mtllib.replace('.mtl', mtlindex_ext, mtllib)
TypeError: 'str' object cannot be interpreted as an integer
Error: Something went wrong, unable to write .scn file. Check directory permissi
ons of export directory.
location: <unknown location>:-1
location: <unknown location>:-1
-
And another one bug
it starts after I atteached texture to material and then make proxy
ERROR: ERROR in XML mtl lib file: Attempting to redefine map: Image_Texture_2214069999784
File name: D:/Proxy/Corona/Trees/Suzanne.mtl
XML tree path:
<mtlLib>
<mapDefinition name="Image_Texture_2214069999784">Corona: Writing configuration file Scene.conf
Corona: Writing scene file Scene.scn
Corona: Writing material file D:\tmp\Scene.mtl
Corona: Writing material file D:\tmp\meshes\Cube.mtl
Info: Total export time: 0.01
Corona: corona C:\Program Files\Corona Standalone\CoronaStandalone_Release.exe file D:\tmp\Scene.scn image D:\tmp\render\Scene1.png
Corona: Rendering scene file Scene.scn...
Corona: Launching Corona Renderer...
Corona: Output image exists...
License info:
Demo license active.
Activated until: 2017-06-26
ERROR: ERROR in XML mtl lib file: Attempting to redefine map: Image_Texture_2214069999784
File name: D:/Proxy/Corona/Trees/Suzanne.mtl
XML tree path:
<mtlLib>
<mapDefinition name="Image_Texture_2214069999784">
-
Thanks I will have a look at that today if I get the time.
-
For that last one you reported are you doing an external proxy to an object already in your .blend file by any chance?
I can't really find a way to reproduce it unless by chance.
-
For that last one you reported are you doing an external proxy to an object already in your .blend file by any chance?
I can't really find a way to reproduce it unless by chance.
Yes, it was external proxy, original objects is in blend but on disabled layer.
I tried new empty file, only standart cube, I've taked preveously exported suzanne.obj, mtl and mtlindex as external proxy and got this
Read new prefs: C:\Users\Sasha\AppData\Roaming\Blender Foundation\Blender\2.78\c
onfig\userpref.blend
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
found bundled python: C:\Program Files\Chaos Group\Blender 2.78 (With V-Ray Addi
tions)\2.78\python
V-Ray For Blender: Parsing plugin descriptions... done [00:00.09]
V-Ray For Blender: vfb_load()
V-Ray For Blender: vfb_get_exporter_types()
Non-zero to use undersampling, 0 otherwise. The value specifies the blur resolut
ion. Value of n means 1/(2^n) initial resolution in each dimension.
renderman_for_blender updater verbose is enabled
Read in json settings from file
--------------------------------------------
Corona: Bitbucket version 6.0.13
Corona: Starting add-on, version 6.0.11
Adding UI Panel: Corona render settings
Adding UI Panel: camera
Adding UI Panel: material
Adding UI Panel: environment
Adding UI Panel: particle systems
Adding UI Panel: Corona render passes
Adding UI Panel: Corona object properties
Adding UI Panel: lamp
Corona: Add-on started
--------------------------------------------
read blend: D:\Proxy\Corona\test2.blend
Corona: Writing configuration file Scene.conf
Corona: Writing scene file Scene.scn
Corona: Writing material file D:\Tmp\Scene.mtl
Info: Total export time: 0.02
Corona: corona D:\soft\Corona Standalone\CoronaStandalone_Release.exe file D:\Tm
p\Scene.scn image D:\Tmp\render\Scene0.png
Corona: Rendering scene file Scene.scn...
Corona: Launching Corona Renderer...
Corona: Output image exists...
License info:
Demo license active.
Activated until: 2017-06-25
ERROR: Fatal error in mtl-XML file: 'D:/Proxy/Corona/Suzanne.mtl': Texture with
file name: 'D:/Proxy/Corona/D:/Mat/apple.jpg' not found/not accesible
-
Try v6.0.14 I have fixed several issues around using external proxy objects and particle emitters.
-
@blanchg You are the best
All problems has been solved
-
@blanchg Is it possible to use a group instance for proxy? Under Corona Object Properties, I can choose a group instance in the Instance Object filed, but when I hit render, it doesn't show up in the render.
-
@blanchg Is it possible to use a group instance for proxy? Under Corona Object Properties, I can choose a group instance in the Instance Object filed, but when I hit render, it doesn't show up in the render.
You can just Shift+A>Group Instance
It's easier to preview and manipulate, effect wil be the same and it works with external proxy very well
-
Hey,
Just started exploring this now too. I opened a high poly bed file and exported it as a proxy with a the object and .mtl file.
I opened a new .blend file and made a cube and attached the bed proxy to it, however the materials are all incorrect. I was wondering if thats just something to do with the .mtl file or if its possible to keep textures and full materials applied to the proxy?
-
It *should* work did you do an export of the bed first?
Any errors in the output?
-
Yeah, so I opened the original .blend file for the bed and then exported it as a proxy into a folder I named "proxy"
Then in the new blend file I created a basic box which i linked to the newly created proxy file.
This is how it renders as a proxy (proxypic.png), and this is how it should look https://imeshh.com/product/bed-with-big-knit-blanket/
Do I need to export the proxy object to the same folder as the textures folder? or pack the textures?
Sorry and I had no errors when exporting
-
Is the .mtlindex file beside the .mtl and .cgeo/.obj files? Is this binary export or .obj?
-
Yeah the .mtlindex was exported with the .mtl and .cgeo file.
And I think I ticked binary mesh export. I'll need to check when i get back home though
-
If you swap the lines in the mtlindex file does that fix it?
-
It happens sometimes, fix mtlindex text or sort materials in blender as they listed in mtlindex and export proxy again
-
@Sanekum, thanks!
-
Hmmm that sounds like a bug, wonder if I can write them out in the same order Blender has them (which is what was intended) instead of alphabetically.
-
Yes it was a bug, can you please try v8.0.48 I have tried to fix the mtlindex order to match what is in Blender
-
@monkriss Try export your bed to the Proxy folder in the default export folder, not just any folder with a "proxy" name. It needs to be the default export folder under the Render tab in blender. Works for me.
-
Yes it was a bug, can you please try v8.0.48 I have tried to fix the mtlindex order to match what is in Blender
Looks like its still there
-
Can you send me that blend file please?
-
Can you send me that blend file please?
It's there attached to message
-
:facepalm:
-
:D :D :D
-
fixed in 8.0.49 thanks for the .blend
-
Problem solved! No matter which folder we export the proxy to, it renders correctly now.
-
Yey this works!! This is such an amazing feature!
I decimated the original bed to have a reference object at only 20k faces. And used the original bed as the external object and it renders in seconds and in full poly!
-
Nice work glad it helps out
-
@blanchg when I try to use proxy with the particle system, I encountered this strange problem. The plane renders correct when it's used just as a plane, but when I use the plane to scatter objects with a ParticleSystem modifier, it renders all black.
Blend file attached for your investigation, I have replaced the external proxy with a simple cube, because I don't know how to embed the proxy in the blend file, but the problem is the same with a cube as with an external proxy. BTW, thank you 3000 for your work on this wonderful addon.
-
@blanchg when I try to use proxy with the particle system, I encountered this strange problem. The plane renders correct when it's used just as a plane, but when I use the plane to scatter objects with a ParticleSystem modifier, it renders all black.
Blend file attached for your investigation, I have replaced the external proxy with a simple cube, because I don't know how to embed the proxy in the blend file, but the problem is the same with a cube as with an external proxy. BTW, thank you 3000 for your work on this wonderful addon.
Plane is not black, it's just disabled for rendering as an emitter.
For Cycles there is a button, but in the Corona it does not work
As a workaround for grass fields etc. I just duplicate ground mesh without particle system
-
@Sanekum Thanks! Is your "duplicate ground mesh" workaround able to render a relatively large vegetation scene like 300m x 300m full of plants, without hardware overload?
-
@Sanekum Thanks! Is your "duplicate ground mesh" workaround able to render a relatively large vegetation scene like 300m x 300m full of plants, without hardware overload?
I make small test and noticed one thing, in my files emitter is renderable, but I'm pretty shure that had same issue as you some times when I create grass, gonna figure out
I made landscape 1x1km and add particle system with group of 8 different trees, each one of them is about 500k-1mln tris
Main hardware overload is not from how many proxys you are using, but how many of them are unique
8 different proxy tree 100000 instance total eats 3993mb Ram
8 different proxy tree 10000 instance total eats 3882mb Ram
1 proxy tree 100000 instance total 1487mb Ram
-
Main thing that is the more particles you have the more time it takes to export, even with proxy, and number of particles encrease file size
1000 particles with 500 childrens gives total 500000 particles and about 13mb for my blend file, but 500000 emission number without childrens gives 220mb blend file
-
@Sanekum Yes, the "ground plane disable" bug shows up in some cases, but not in other cases. Hard to pinpoint the exact cause to find a definitive solution.
In your "1 proxy tree 100000 instance total 1487mb Ram" example, did you Alt+D to create the 100 children (=100 instances), then group the 100 instances as a unit for particle emission?
-
@Sanekum Yes, the "ground plane disable" bug shows up in some cases, but not in other cases. Hard to pinpoint the exact cause to find a definitive solution.
In your "1 proxy tree 100000 instance total 1487mb Ram" example, did you Alt+D to create the 100 children (=100 instances), then group the 100 instances as a unit for particle emission?
No I didn't duplicate anything, all instancing are made by particle system only, from one proxy object, and for the children I use Children menu
Very powerfull featureif you need massive amount of particles
I made test with group of 100 proxy duplicates as you mention and there is no difference in Ram usage
-
I can't look this week as I don't have a computer. I will be getting a new one next week though.
-
@blanchg thank you as always, no hurry.
@Sanekum your testing data are very helpful to optimize ram. I'll try the children menu.
-
@blanchg thank you as always, no hurry.
@Sanekum your testing data are very helpful to optimize ram. I'll try the children menu.
I am glad to help, if you need to make realy large scene with aerial view or similar and suffer from Ram overload you can also use trick with single proxy and MultiShader material
For example it's all one single proxy tree instanced by particle system, I haven't worked very much with this feature yet, but it can give good results with more tweaking
And it works not only for trees, I made car paint material with it
-
haha, you are so resourceful!
-
Today I had some time to check how the proxies work, and so far they work even better than linking groups from Blender files which I have to used in my workflow. Using proxies saves a lot of time and avoids of missing textures. But I wonder how they will work with the new version of Standalone etc? I used many versions of Corona beginning from 1.5 to 3.0 and every change of Standalone required to do export from start, even if i had "Overwite geometry" to "only modified" checked.
-
A personal library of proxies could be created and I could have a script to run proxy export on a folder of .blend files. They should only need exporting again though as new features are added and you want to use them or a major format change is required.
Workflow bumps like this can be handled if you let me know about them 😁
-
Wow, even linked groups with added proxy works without any problem :D
-
@Zorian, i'm glad you got it working, but what the hell is going on in your scene haha!
-
Perhaps the next generation of the Batley Townswomen's Guild, carrying on the fine tradition of re-enactments?