## Exporter for Rhinoceros

General discussion regarding exporter development in general.

Moderators: Ratow, coordinators

### Re: Exporter for Rhinoceros

early or later....
here a usefull tool for the materials editors and lighting....

http://wiki.mcneel.com/labs/rendererdevelopmentkit10

patro

Posts: 1798
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

### Re: Exporter for Rhinoceros

jeanphi wrote:Hi,

I think the issue with your exported data might be the order of u and v control points in the P list. I guess your outer loop is on u and your inner loop on v, while LuxRender expects the opposite (don't ask why).

Jeanphi

Ok I won't ask why... But, I am not controlling the order, that is how rhino is giving them to me. I tried a quick test just to reverse the entire P array (per point, not per element), but that had no affect for me? Perhaps I messed up. At any rate, I think I won't worry about nurbs for the time being as nobody has jumped up and said that trimming is possible.

patro wrote:early or later....
here a usefull tool for the materials editors and lighting....

http://wiki.mcneel.com/labs/rendererdevelopmentkit10

Patro, have you used the RDK? I looked at it, but it seems it is for a C/C++ plugin, and not for lowly scripters such as myself. I did do some tinkering with what they say here http://wiki.mcneel.com/developer/rdkrhinoscripting about scripting the rdk, but within python, and I am talking to the com object and have grabbed some values from it, so I guess it works. I will investigate how to actually use it. The jargon is cryptic. My plan was going to be to just tag objects with a named material, but maybe it will be better to use rhino's mat system, even though I don't particularly care for it. But materials are way down the line for now...

A note on progress: not much. I redid some of the mesh export stuff as I found out it wasn't respecting viewport visibility. Getting block export to respect layer visibility and hidden-ness is tricky for some reason, so still working on that. I did successfully make light portals and meshlights today. By the way, I could not find much mention of these in the scene file docs other than they exist. Luckily, I was able to drum up some examples hidden here in the forum. The same with ies and infinite lights. The next milestone is to finish up block visibility and support light portals, area lights, mesh lights, ies lights, and environments.

Thanks,

Nathan
nart

Posts: 17
Joined: Fri Oct 07, 2011 3:40 pm

### Re: Exporter for Rhinoceros

nart wrote:Ok I won't ask why... But, I am not controlling the order, that is how rhino is giving them to me. I tried a quick test just to reverse the entire P array (per point, not per element), but that had no affect for me? Perhaps I messed up. At any rate, I think I won't worry about nurbs for the time being as nobody has jumped up and said that trimming is possible.

Ok, then you need to do the striping on the data before writing it to the exported file:
Code: Select all
# Pseudo python code where nu, nv define the number of control points, data if the list of control points provided by Rhinofor v in range(nv):   for u in range(nu):      output data[u * nv + v]

Regarding trimming, I think it is possible provided the right knot values.

Jeanphi
jeanphi

Posts: 6569
Joined: Mon Jan 14, 2008 7:21 am

### Re: Exporter for Rhinoceros

Patro, have you used the RDK? I looked at it, but it seems it is for a C/C++ plugin, and not for lowly scripters such as myself. I did do some tinkering with what they say here http://wiki.mcneel.com/developer/rdkrhinoscripting about scripting the rdk, but within python, and I am talking to the com object and have grabbed some values from it, so I guess it works. I will investigate how to actually use it. The jargon is cryptic. My plan was going to be to just tag objects with a named material, but maybe it will be better to use rhino's mat system, even though I don't particularly care for it. But materials are way down the line for now...

unfortunately i never did.... i downloaded it in the past to use it with a free renderer made with the RenderMan code, available also for rhino..
i didn't got it working, but the rhino plugin was ok.

patro

Posts: 1798
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

### Re: Exporter for Rhinoceros

Hi,

I found the answer for the extraneous knots in opennurbs (order is the order of the NURBS, n is the number of control points, knots is the list of knots from Rhino):
- by default you duplicate the first and last knots
- if order>2 and n>=2*order-2 and n>=6 then apply the following:
- if knot[n-1]<knot[order+n-3] then add knot[order+1]-knot[order] to the last knot
- if knot[0]<knot[order-2] then substract knot[n-order+1]-knot[n-order] to the first knot

Jeanphi
jeanphi

Posts: 6569
Joined: Mon Jan 14, 2008 7:21 am

### Re: Exporter for Rhinoceros

Ok thanks jeanphi. Since you say that trimming is possible I'll try out your suggestions on the P and knot arrays.

On a simpler note, does anyone have an example of what is expected from the 'special "area light" object' mentioned here in the manual:

Since most 3D packages feature an "area" light type, LuxRender also has a special "area light" object for these to be exported as. The area light object behaves exactly the same as a meshlight with the same geometry and emission settings, with one important distinction: You cannot use a scale transform with it, you must adjust its actual geometric size. In most modeling packages, this can be adjusted with a "size" or "dimensions" parameter for their area light object.

Or is the special case just a mesh light with quad sized/oriented the same as the area light in the host app? I can't find an example or parameters in the docs.

Thanks,

Nathan
nart

Posts: 17
Joined: Fri Oct 07, 2011 3:40 pm

### Re: Exporter for Rhinoceros

It's just in the host app (more the exporter), I think the info in the wiki may be somewhat incorrect. It's just a regular plane set as a light. Or at least that's how LuxBlend handles it.
-Jason

J the Ninja

Posts: 2208
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

### Re: Exporter for Rhinoceros

Ok thanks J the Ninja. I'm not going to worry about making equivalent rhino light types (area, point, etc..). I think I have a good start for mesh lights and light grouping now, so I'll stick with that (plus I never use the others anyway):

I was able to get mesh lights, light groups, light properties (power, color, ies...), and light portals working. I also sorted the block visibility problem. I think it is a good time to do some code organization/optimization on the geometry handling, as I think that part should be fairly static from here on out.

Thanks,

Nathan
nart

Posts: 17
Joined: Fri Oct 07, 2011 3:40 pm

### Re: Exporter for Rhinoceros

wow....

patro

Posts: 1798
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

### Re: Exporter for Rhinoceros

Hi,

Great progress! Tell me if you want to set up a source code repository here or have an announcement or some more visibility from the main pages of the site.

Jeanphi
jeanphi

Posts: 6569
Joined: Mon Jan 14, 2008 7:21 am

PreviousNext