Chaos Corona Forum

General Category => Porting and API => Chaos Corona for Blender => Topic started by: Rac Leborg on 2017-05-14, 19:03:31

Title: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-14, 19:03:31
Hi All (I originally posted this at the end of Asticles topic on Hair Instances, but I should probably have created a new post - so here it is)

I am struggling to EXPORT OBJECTS (only modified) for the BLENDER HAIR particles, (for a simple carpet type).

1000 hairs  is ok until I switch on INTERPOLATION(default settings) and then it is either never going to finish or the system is hanging.

Switching DEBUG on and off  is making no difference.

Could someone give me a rough idea on how long the EXPORT should take with the attached carpet.blend file, with an I7 920 and 8gig ram.

Many thanks
Title: Re: Export Hair Particle Issue
Post by: burnin on 2017-05-14, 23:27:41
i guess 100x1000 children to render is an overkill or smthng, set to same as in preview (10x1000)
tho there are some bugs with hair generation:
- using Ribbon for Strand Shape produced and error
- lowering Render Path Steps to 2, produces an error / twice*

....
experimenting further... ;)
(http://i.imgur.com/i0CN1rr.jpg)
use scarcely (alpha stage, not really production ready), to be on the safe side rather Render Objects (also better control of the 'look') than Paths

Edit:
Basically am getting errors on the first time after changing few settings, then after, just switching some element on&off, error doesn't occur anymore... and so on.

here are Ribbons 50children250particles=125K hairs
(http://i.imgur.com/m7jGLhQ.jpg)

Is there a size limit (polys/verts) per object for the exporter?
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-14, 23:45:50
I might have a way to make it faster again, just running tests on it now.
Title: Re: Export Hair Particle Issue
Post by: burnin on 2017-05-15, 00:18:21
*Error from lowering value of Hair Render Path Steps to 2:
Code: [Select]
Traceback (most recent call last):
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\engine.py", line 356, in render
    render_start( self, scene)
  File "C:\Users\py\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\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\engine.py", line 195, in render_scene
    result = bpy.ops.corona.export()
  File "C:\programi\b278c\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\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\operators\export.py", line 42, in execute
    result = export(self, scene, placeholders)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 290, in export
    return _write(self, scene, filepath, curves)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 322, in _write
    result = future.result(timeout = None)
  File "C:\programi\b278c\2.78\python\lib\concurrent\futures\_base.py", line 405, in result
    return self.__get_result()
  File "C:\programi\b278c\2.78\python\lib\concurrent\futures\_base.py", line 357, in __get_result
    raise self._exception
  File "C:\programi\b278c\2.78\python\lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 372, in _export_object
    result = decide_format( self, full_path, obj, scene, curves)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 258, in decide_format
    return write_binary_obj( self, obj_path, obj, scene, curves)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 887, in write_binary_obj
    meshes.extend( get_hairs(ob, scene, psys, crv_ob, crv, material, mesh))
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 242, in get_hairs
    crv_ob.data = crv_data
AttributeError: Writing to ID classes in this context is not allowed: corona_hair_tmp_curve.004_ob, Object datablock, error setting Object.data

location: C:\programi\b278c\2.78\scripts\modules\bpy\ops.py:189



location: <unknown location>:-1


Thick, 3 Steps
(http://i.imgur.com/1LWHhgH.jpg)

----------

I might have a way to make it faster again, just running tests on it now.

Nice :)
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-15, 00:27:45
That is a painful error, I will see what I can do, I think it is Blender freeing memory before we are finished with the objects.
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-15, 01:16:31
New hair exporter is available.

Make sure you are using binary object export, export hair is checked and stream hair is checked.

You can see some of the improvement in the attached graph
Title: Re: Export Hair Particle Issue
Post by: burnin on 2017-05-15, 01:48:26
Ah, ok... Nice to know, user friendly info always helps :)

Also found
Path Timing is partly broken. (Start & End are fine).
Random value corrupts the influenced children - their tips are joined/pulled into the world origin / coordinate center (0,0,0).
eg.
(http://i.imgur.com/0Y6YN18.jpg)

PS.
(Orange) "2 = Error" is from previously mentioned problem. (would be fine if lower value is blocked - 3 (default) as the lowest value).
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-15, 02:15:02
Do you have a sample .blend for this? I can't reproduce your 2 error or the random error.
Title: Re: Export Hair Particle Issue
Post by: burnin on 2017-05-15, 02:30:55
Yup, file attached...
... and with the latest exporter (5.7.1) this scene became totally unusable - error is all i get:
Code: [Select]
Traceback (most recent call last):
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\engine.py", line 356, in render
    render_start( self, scene)
  File "C:\Users\py\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\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\engine.py", line 195, in render_scene
    result = bpy.ops.corona.export()
  File "C:\programi\b278c\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\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\operators\export.py", line 42, in execute
    result = export(self, scene, placeholders)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 547, in export
    return _write(self, scene, filepath, curves)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 580, in _write
    result = future.result(timeout = None)
  File "C:\programi\b278c\2.78\python\lib\concurrent\futures\_base.py", line 405, in result
    return self.__get_result()
  File "C:\programi\b278c\2.78\python\lib\concurrent\futures\_base.py", line 357, in __get_result
    raise self._exception
  File "C:\programi\b278c\2.78\python\lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 637, in _export_object
    result = decide_format( self, full_path, obj, scene, curves)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 515, in decide_format
    return write_binary_obj( self, obj_path, obj, scene, curves)
  File "C:\Users\py\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\render_corona\export.py", line 1223, in write_binary_obj
    if faceuv or facecol:
UnboundLocalError: local variable 'faceuv' referenced before assignment

location: C:\programi\b278c\2.78\scripts\modules\bpy\ops.py:189



location: <unknown location>:-1

Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-15, 02:31:51
Thanks will fix asap
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-15, 02:42:03
faceuv error is now fixed, still can't reproduce your random error or step=2 (I can export down to 0) error sorry
Title: Re: Export Hair Particle Issue
Post by: burnin on 2017-05-15, 02:54:57
:D No problem,  can't reproduce neither of the bugs anymore. Using 5.7.2. Fixed. :)
Thanks for everything and all best... going off for a bit longer moment now.

Cheers

Edit:
Couldn't let it go.
Can't turn off Parents from always Rendering & Random centrifuge seems to be back. File attached.
eg.

Parents: ON, Random: OFF
(http://i.imgur.com/gqeUC4K.jpg)

Parents: OFF, Random: ON
(http://i.imgur.com/Np4Sybo.jpg)
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-15, 20:09:14
Hi

Sorry to say that I am still having a problem exporting hairs. (50,000) with Version 5.7.3 (I don't know where to download 5.7.1)

I have attached the error message.

Thanks

Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-15, 21:42:34
Sorry to say that I am still having a problem exporting hairs. (50,000) with Version 5.7.3 (I don't know where to download 5.7.1)
v5.7.4 has fixed this issue.

@burnin I am looking at those two issues now!  Thanks for persisting :D
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-15, 23:42:46
Thanks @burnin,

This highlighted an issue with parents and children and how they are counted/calculated.
The hairs converging into the center was another issue which is solved now too.
Title: Re: Export Hair Particle Issue
Post by: burnin on 2017-05-16, 01:21:03
Thanks @burnin,

This highlighted an issue with parents and children and how they are counted/calculated.
The hairs converging into the center was another issue which is solved now too.

:D
Nice, yes! ...  & don't mention it, i thank you!
:)
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-16, 20:30:16
Thank you for all the time that you are spending on fixing this issue. Unfortunately, it is still not working for me. Anything over about 25,000 (5000 x 5)hairs and my system hangs, and even at lower counts it is still very unreliable. Maybe I have something wrong in my system configuration?

(edited) If I use cycles, then I have no issues even with overkill quantities of hairs.
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-16, 21:34:58
Please provide a log or a .blend file.  I can use 100,000 hairs no problem on a laptop (150 second export time).  Comparing to cycles is a bit unfair as it never exports the geometry for each hair before rendering.
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-16, 21:51:06
Hi Blanchg

Firstly, sorry for making the comparison- no offense was meant, I am really enjoying learning Corona. I was just trying to give some info about what is happening. (I'm a newbie).

I don't know how to obtain a log file as, after waiting a few minutes into the EXPORT, if I click anywhere on the screen Corona hangs with that 'white screen of death'.

I have uploaded a blend file which is having the issues mentioned.

Thanks again for you help

Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-16, 21:55:50
No offense taken :D sorry it is 5:30 in the morning here!

If you go window > toggle system console before you start the render the console will appear.  Then you can copy from that window by selecting the text.

Thanks for the .blend I will have a look and see.
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-16, 22:30:46
5.30! I hope you weren't woken up by an alarm telling you that there's a newbie in the UK who hasn't got a clue ;)

I have done the 'toggle system console', but as soon as I hit EXPORT it closes, and then I can't open it again because Corona crashes.

I will try again tomorrow as it is about time here for me to hit the sack. So (goodnight) good morning and I hope there is a nice day ahead for you.
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-16, 23:52:34
Sadly I am on my way to work
Another way to see the console is to start blender from the command line.  Open File Explorer and navigate to your blender directory then in the path area type cmd.exe and press enter.

From there you can type blender.exe and hopefully blender starts up.

That way when blender crashes the command window will still contain all the logs.
Title: Re: Export Hair Particle Issue
Post by: burnin on 2017-05-17, 01:42:02
@Rac Leborg

1. Enable:
- Binary Mesh Export
- Export Hair
- Stream Hair

2. Use correct path for Export. (clear the contents, just to be sure no mixing is involved)

3. Set Particle System Emission number to lower value, ie: 100 - for testing purposes, to see if it at least renders a small number, then gradually up the count to see where the limit is. Otherwise you could be waiting minutes & hours for an error, wasting your precious time.
Keep in mind - Exporting process runs on a single core (White Screen/Not Responding) - use more efficient methods & techniques to grow grass or hair or...

Result:
(http://i.imgur.com/hSbVQ81.jpg)
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-17, 20:19:48
burnin, thanks for the advice. So far I am on about 15,000 hairs before it fails. Cleaning out the export folder definitely helps!

Cheers
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-17, 20:54:35
How much free disk space and how much free memory do you have?
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-17, 22:01:47
8GIG RAM and 30gig Storage on an SSD.

I might have found myself a workaround?:

I can convert the particles to a mesh - which is almost instant, and renders ok. Blender still keeps the original hair particles, which I switch off for rendering.



Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-17, 22:53:59
.... actually, (sorry for this) but I don't think the workaround is working. I will try it out again tomorrow. :(
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-17, 23:01:48
How much of your memory is actually free (look in the windows task manager) and how much of your disk is free (the 30GB?)
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-17, 23:47:34
I am only using 18% of the RAM when exporting and I have about 12gig  spare on the SSD.
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-18, 20:07:29
I have attached an error message that I get with 15,000 hairs.

I have freed up my SSD so there is now 35 gigs spare on a 120 gig drive. 8gig ram with only 18% being used at maximum.

I have also reinstalled Blender and Corona, but sadly to no avail.

Thanks again for your relentless help.

Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-18, 21:18:18
Your PC might be too fast :D

I fixed this error in v5.7.12 can you give it a go?
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-18, 22:15:12
I think you've nailed it! :)

Just done 20,000 without any issue, which is enough for me. I will push it further over this weekend and report back.

Anyway, many thanks. I will message again soon.
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-22, 23:28:41
Maybe I have a setting somewhere that is screwing everything up with this as it is still not working for me.
I have so much that I want to learn with Corona, so I'll move away from hair for a short while (to be honest, it's not at all a crucial requirement for me)and come back to it a bit later on when I have a better idea of what I am doing.
Sorry for the disappointing news on this.
Title: Re: Export Hair Particle Issue
Post by: blanchg on 2017-05-22, 23:40:24
When you get back to it make sure you include the error, it might be something else that is easy to fix.
Title: Re: Export Hair Particle Issue
Post by: Rac Leborg on 2017-05-25, 19:49:26
blanchg.

It's working. For sure this time. 100,000. Iv'e done a few tests and it always works!

I'm not sure what was wrong before? Possibly  a setting that I had got at an extreme level, or whatever. Anyway, excellent. Many thanks for all your help.

Cheers
Title: Re: Export Hair Particle Issue
Post by: Zorian on 2017-08-18, 13:49:36
Does anybody know how to make hairparticiples withe texture assigned? I've tried everything. Adding textures in participle setting doesn't work. Adding textures in texture window doesn't work either.

Strand render is assigned and as a strand color UV texture map.

Log:
Quote
Error: Traceback (most recent call last):
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\operators\export.py", line 42, in execute
    result = export(self, scene, placeholders)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 557, in export
    return _write(self, scene, filepath, curves)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 612, in _write
    result = future.result(timeout = None)
  File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\concurrent\futures\_base.py", line 405, in result
    return self.__get_result()
  File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\concurrent\futures\_base.py", line 357, in __get_result
    raise self._exception
  File "C:\Program Files\Blender FouTraceback (most recent call last):
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\engine.py", line 497, in render
    render_start( self, scene)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\engine.py", line 174, in render_start
    render_scene( engine, scene)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\engine.py", line 333, in render_scene
    result = bpy.ops.corona.export()
  File "C:\Program Files\Blender Foundation\Blender\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\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\operators\export.py", line 42, in execute
    result = export(self, scene, placeholders)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 557, in export
    return _write(self, scene, filepath, curves)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 612, in _write
    result = future.result(timeout = None)
  File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\concurrent\futures\_base.py", line 405, in result
    return self.__get_result()
  File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\concurrent\futures\_base.py", line 357, in __get_result
    raise self._exception
  File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 688, in _export_object
    result = decide_format( self, file_path, obj, scene, curves, obj_ext)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 525, in decide_format
    return write_binary_obj( self, obj_path, obj, scene, curves, obj_ext)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 1261, in write_binary_obj
    uvlayer_buff, layers, mod)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 374, in streamcgeo_hairs
    result = future.result(timeout = None)
  File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\concurrent\futures\_base.py", line 405, in result
    return self.__get_result()
  File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\concurrent\futures\_base.py", line 357, in __get_result
    raise self._exception
  File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 510, in extract_curve
    uvlayer_buff, layers, obj, scene)
  File "C:\Users\Adam\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\coronablender-render_corona-27583caece46\export.py", line 1504, in cgeo_write_mesh
    uv_layer_face_maps[layercount] = uv_face_mapping = [None] * len(face_index_pairs)
IndexError: list assignment index out of range

location: C:\Program Files\Blender Foundation\Blender\2.78\scripts\modules\bpy\ops.py:189



location: <unknown location>:-1

location: <unknown location>:-1
Title: Re: Export Hair Particle Issue
Post by: burnin on 2017-08-18, 23:52:24
It seems that as soon as UV map is created, error appears.
After UV map is deleted the rendering works again.
Title: Re: Export Hair Particle Issue
Post by: Zorian on 2017-08-19, 08:39:03
Yes, indeed - you can also change strand color in Corona Hair Rendering from UV Texture Map to None. Then it works fine, but without aby color.