Re: [Bf-committers] [GSoC 2018]Idea -- Fast Import / Export for selected formats

2018-03-08 Thread Campbell Barton
On Thu, Mar 8, 2018 at 7:53 PM, Paul Melis  wrote:
> Hi Campbell,
>
> On 08-03-18 04:48, Campbell Barton wrote:
>>
>> Supporting C/C++ in an add-on means there is technically nothing
>> stopping someone from bundling an entire library.
>>
>> While it's possible this makes sense in some cases, it introduces
>> issues with having to properly integrate a library into Blender
>> (workaround constraints in the API, even bugs).
>> Notice the add-on linked misses support for things currently working
>> in our add-on.
>> While it could be fixed, that add-on is basically moving from Python
>> to C which is quite a different project.
>
>
> Thats' true. I actually didn't spend too much time on the add-on, as I
> mostly use the bundled script (mesh_readply.py) directly in other scripts
> that need to load data from PLY. Interactive import happens a lot less (and
> even then I frequently use blender -P mesh_readply.py...).
>
>> For the GSOC I rather we keep a Python reference implementation with a
>> C fast-path which is typically useful for parsing arrays of geometry.
>
>
> I will be interested to see how the GSOC work pans out. Going through
> Python, even when being able to pass arrays/buffers is still somewhat
> suboptimal in the current setup. Setting up a Mesh with UVs and such takes a
> bit of work and having to use 4 indices per triangle to pass to
> foreach_set('vertices_raw',...) is unfortunate. I didn't look into it, but
> is passing polygons with more than 4 vertices even possible, or would you
> need to tessellate the geometry first yourself?

Done carefully, we can ensure float arrays are used (no conversion to
lists of Py objects) so it should be quite fast.
You can create ngons if you need but this involves calculating
loop-offsets for each polygon.

>> PLY and STL are simple enough formats that I'm skeptical of the value
>> of using 3rd party libraries.
>
>
> Fair point. STL is a no-brainer to implement oneself. For PLY I used rply
> because it exists and I didn't want to spend time on writing a PLY reader
> (and it supports both binary and ascii variants of .ply). The API is
> actually a bit quirky, with all the callbacks.

Moving the entire import/export into C code or not has a lot to do
with whoever maintains the code.
If we had developers eager to write & maintain high quality C/C++
io-addons for Blender, I'm not against it.
It's just that in the past we had more active development with Python.
In 2.4x we had import/export written in C, almost nobody improved of
fixed bugs there.

On the other hand, things might have changed since then.


> Regards,
> Paul
>
>
> --
>
> Paul Melis
> | Visualization group leader & developer | SURFsara |
> | Science Park 140 | 1098 XG Amsterdam |
> | T 020 800 1312 | paul.me...@surfsara.nl | www.surfsara.nl |



-- 
- Campbell
___
Bf-committers mailing list
Bf-committers@blender.org
https://lists.blender.org/mailman/listinfo/bf-committers


Re: [Bf-committers] [GSoC 2018]Idea -- Fast Import / Export for selected formats

2018-03-08 Thread Paul Melis

Hi Campbell,

On 08-03-18 04:48, Campbell Barton wrote:

Supporting C/C++ in an add-on means there is technically nothing
stopping someone from bundling an entire library.

While it's possible this makes sense in some cases, it introduces
issues with having to properly integrate a library into Blender
(workaround constraints in the API, even bugs).
Notice the add-on linked misses support for things currently working
in our add-on.
While it could be fixed, that add-on is basically moving from Python
to C which is quite a different project.


Thats' true. I actually didn't spend too much time on the add-on, as I 
mostly use the bundled script (mesh_readply.py) directly in other 
scripts that need to load data from PLY. Interactive import happens a 
lot less (and even then I frequently use blender -P mesh_readply.py...).



For the GSOC I rather we keep a Python reference implementation with a
C fast-path which is typically useful for parsing arrays of geometry.


I will be interested to see how the GSOC work pans out. Going through 
Python, even when being able to pass arrays/buffers is still somewhat 
suboptimal in the current setup. Setting up a Mesh with UVs and such 
takes a bit of work and having to use 4 indices per triangle to pass to 
foreach_set('vertices_raw',...) is unfortunate. I didn't look into it, 
but is passing polygons with more than 4 vertices even possible, or 
would you need to tessellate the geometry first yourself?



PLY and STL are simple enough formats that I'm skeptical of the value
of using 3rd party libraries.


Fair point. STL is a no-brainer to implement oneself. For PLY I used 
rply because it exists and I didn't want to spend time on writing a PLY 
reader (and it supports both binary and ascii variants of .ply). The API 
is actually a bit quirky, with all the callbacks.


Regards,
Paul

--

Paul Melis
| Visualization group leader & developer | SURFsara |
| Science Park 140 | 1098 XG Amsterdam |
| T 020 800 1312 | paul.me...@surfsara.nl | www.surfsara.nl |
___
Bf-committers mailing list
Bf-committers@blender.org
https://lists.blender.org/mailman/listinfo/bf-committers


Re: [Bf-committers] [GSoC 2018]Idea -- Fast Import / Export for selected formats

2018-03-07 Thread Campbell Barton
Supporting C/C++ in an add-on means there is technically nothing
stopping someone from bundling an entire library.

While it's possible this makes sense in some cases, it introduces
issues with having to properly integrate a library into Blender
(workaround constraints in the API, even bugs).
Notice the add-on linked misses support for things currently working
in our add-on.
While it could be fixed, that add-on is basically moving from Python
to C which is quite a different project.

For the GSOC I rather we keep a Python reference implementation with a
C fast-path which is typically useful for parsing arrays of geometry.

PLY and STL are simple enough formats that I'm skeptical of the value
of using 3rd party libraries.


On Wed, Mar 7, 2018 at 11:23 PM, Paul Melis  wrote:
> Hi,
>
> This might not be fully using the same technical approach, but see
> https://github.com/paulmelis/blender-ply-import for another way of doing
> faster PLY imports.
>
> Regards,
> Paul
>
>
> On 14-02-18 03:35, Campbell Barton wrote:
>>
>> Hi, your question is too general, best do some research into this
>> topic and ask more detailed questions as you need.
>>
>> Suggestions.
>> - Read over PLY and STL source code.
>> - Find bottleneck's that compiled code could help with.
>> - Apply the patch D2835 (linked from the idea's page) and try make a
>> simple C module.
>>
>>
>>
>>
>> On Wed, Feb 14, 2018 at 2:23 AM, 4649tz <464...@gmail.com> wrote:
>>>
>>> Hi,
>>>  I am Ze Dang,a junior studying in Wuhan Institution of
>>> Technology,China.
>>>  I read the confirmed ideas and found that the idea - Fast Import /
>>> Export for selected formats which I was really interested in. I think I have
>>> been equipped with the requirements written on the page.
>>> But unfortunately this is the first time I have taken part in a event
>>> like this.( So,could you please give me some advice that how can I make an
>>> excellent proposal on the idea and share my power to it?
>>> Thank you :)
>>> ___
>>> Bf-committers mailing list
>>> Bf-committers@blender.org
>>> https://lists.blender.org/mailman/listinfo/bf-committers
>>
>>
>>
>>
>
>
> --
>
> Paul Melis
> | Visualization group leader & developer | SURFsara |
> | Science Park 140 | 1098 XG Amsterdam |
> | T 020 800 1312 | paul.me...@surfsara.nl | www.surfsara.nl |



-- 
- Campbell
___
Bf-committers mailing list
Bf-committers@blender.org
https://lists.blender.org/mailman/listinfo/bf-committers


Re: [Bf-committers] [GSoC 2018]Idea -- Fast Import / Export for selected formats

2018-03-07 Thread Paul Melis

Hi,

This might not be fully using the same technical approach, but see
https://github.com/paulmelis/blender-ply-import for another way of doing 
faster PLY imports.


Regards,
Paul

On 14-02-18 03:35, Campbell Barton wrote:

Hi, your question is too general, best do some research into this
topic and ask more detailed questions as you need.

Suggestions.
- Read over PLY and STL source code.
- Find bottleneck's that compiled code could help with.
- Apply the patch D2835 (linked from the idea's page) and try make a
simple C module.




On Wed, Feb 14, 2018 at 2:23 AM, 4649tz <464...@gmail.com> wrote:

Hi,
 I am Ze Dang,a junior studying in Wuhan Institution of Technology,China.
 I read the confirmed ideas and found that the idea - Fast Import / Export 
for selected formats which I was really interested in. I think I have been 
equipped with the requirements written on the page.
But unfortunately this is the first time I have taken part in a event like 
this.( So,could you please give me some advice that how can I make an excellent 
proposal on the idea and share my power to it?
Thank you :)
___
Bf-committers mailing list
Bf-committers@blender.org
https://lists.blender.org/mailman/listinfo/bf-committers







--

Paul Melis
| Visualization group leader & developer | SURFsara |
| Science Park 140 | 1098 XG Amsterdam |
| T 020 800 1312 | paul.me...@surfsara.nl | www.surfsara.nl |
___
Bf-committers mailing list
Bf-committers@blender.org
https://lists.blender.org/mailman/listinfo/bf-committers


Re: [Bf-committers] [GSoC 2018]Idea -- Fast Import / Export for selected formats

2018-02-13 Thread Campbell Barton
Hi, your question is too general, best do some research into this
topic and ask more detailed questions as you need.

Suggestions.
- Read over PLY and STL source code.
- Find bottleneck's that compiled code could help with.
- Apply the patch D2835 (linked from the idea's page) and try make a
simple C module.




On Wed, Feb 14, 2018 at 2:23 AM, 4649tz <464...@gmail.com> wrote:
> Hi,
> I am Ze Dang,a junior studying in Wuhan Institution of Technology,China.
> I read the confirmed ideas and found that the idea - Fast Import / Export 
> for selected formats which I was really interested in. I think I have been 
> equipped with the requirements written on the page.
>But unfortunately this is the first time I have taken part in a event like 
> this.( So,could you please give me some advice that how can I make an 
> excellent proposal on the idea and share my power to it?
> Thank you :)
> ___
> Bf-committers mailing list
> Bf-committers@blender.org
> https://lists.blender.org/mailman/listinfo/bf-committers



-- 
- Campbell
___
Bf-committers mailing list
Bf-committers@blender.org
https://lists.blender.org/mailman/listinfo/bf-committers


[Bf-committers] [GSoC 2018]Idea -- Fast Import / Export for selected formats

2018-02-13 Thread 4649tz
Hi,
    I am Ze Dang,a junior studying in Wuhan Institution of Technology,China.
    I read the confirmed ideas and found that the idea - Fast Import / Export 
for selected formats which I was really interested in. I think I have been 
equipped with the requirements written on the page.
   But unfortunately this is the first time I have taken part in a event like 
this.( So,could you please give me some advice that how can I make an excellent 
proposal on the idea and share my power to it?
Thank you :)
___
Bf-committers mailing list
Bf-committers@blender.org
https://lists.blender.org/mailman/listinfo/bf-committers