Support of primitives like Spheres or Cylinders possible?

Discussion related to the 'LuxBlend' Blender 2.4+ python exporter script.

Moderators: Ratow, SATtva, coordinators

Support of primitives like Spheres or Cylinders possible?

Postby B.Y.O.B. » Tue May 01, 2012 2:28 pm

Hi,

I wanted to ask if it was possible to export, say, UVSpheres from Blender to LuxRender as a Lux Sphere (you know, the primitive that's defined by it's midpoint and radius) if there's something like "export as sphere primitive" ticked.
Am I right that this would avoid the terminator issue raytracing suffers from?

Of course it would only be senseful for unmodified UVSpheres (apart from transformations).
User avatar
B.Y.O.B.
 
Posts: 1911
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: Support of primitives like Spheres or Cylinders possible

Postby J the Ninja » Tue May 01, 2012 2:43 pm

B.Y.O.B. wrote:Hi,

I wanted to ask if it was possible to export, say, UVSpheres from Blender to LuxRender as a Lux Sphere (you know, the primitive that's defined by it's midpoint and radius) if there's something like "export as sphere primitive" ticked.
Am I right that this would avoid the terminator issue raytracing suffers from?

Of course it would only be senseful for unmodified UVSpheres (apart from transformations).


Yeah, it would avoid the terminator artifact since it's a geometrically defined sphere. I think it might be possible to mess with the external mesh proxy code to export some other shape, but I haven't looked at it too closely.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2249
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: Support of primitives like Spheres or Cylinders possible

Postby B.Y.O.B. » Tue May 01, 2012 4:55 pm

The best would be if Blender would provide an indicator for if a mesh is changed, so you can check if the UVSphere is a "new" one.
Then, if the "export als primitive" checkbox is checked, the midpoint and the radius had to be found and exported.

I don't know how complicated that would be (also with an eye on translations like resizing...) as I have no idea of the stuff Blender provides here.
User avatar
B.Y.O.B.
 
Posts: 1911
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: Support of primitives like Spheres or Cylinders possible

Postby A-man » Tue May 01, 2012 5:15 pm

I think it should be up to the user to make sure the sphere is not modified. All it should need is the origin (x,y,z) and a radius (taken from the object's 'scale'). It could be a cube or bunny for all the exporter cares.
Studio XPS 9100 | 2.8 Ghz Intel 930 | 12 GB RAM | Radeon 7970 3GB
User avatar
A-man
 
Posts: 691
Joined: Sat Apr 24, 2010 4:24 pm

Re: Support of primitives like Spheres or Cylinders possible

Postby B.Y.O.B. » Wed Aug 15, 2012 6:48 am

Apparently the Blendigo exporter (Blender -> Indigo Renderer) has this feature: a sphere primitive is exported if the object name ends with ".sphere".
http://www.indigorenderer.com/forum/vie ... 90#p115490
User avatar
B.Y.O.B.
 
Posts: 1911
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: Support of primitives like Spheres or Cylinders possible

Postby A-man » Wed Aug 15, 2012 10:07 am

Hey that's a good idea! It should also be able to support other primitives like cylinder and cone and whatnot with the appropriate suffixes using that method.
Studio XPS 9100 | 2.8 Ghz Intel 930 | 12 GB RAM | Radeon 7970 3GB
User avatar
A-man
 
Posts: 691
Joined: Sat Apr 24, 2010 4:24 pm

Re: Support of primitives like Spheres or Cylinders possible

Postby B.Y.O.B. » Wed Aug 15, 2012 10:17 am

I'm not sure though if either the mesh name or the object name should be used... but that's a decision for the programmer, I guess.
User avatar
B.Y.O.B.
 
Posts: 1911
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: Support of primitives like Spheres or Cylinders possible

Postby SATtva » Wed Aug 15, 2012 10:19 am

Unlike a sphere, which dimensions/transforms can be easily calculated from the mesh's bounding box, cylinder and cone are more tricky. For example, how could you know which side is "up" for the cone?
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5542
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: Support of primitives like Spheres or Cylinders possible

Postby J the Ninja » Wed Aug 15, 2012 10:42 am

SATtva wrote:Unlike a sphere, which dimensions/transforms can be easily calculated from the mesh's bounding box, cylinder and cone are more tricky. For example, how could you know which side is "up" for the cone?



Point the tip to +Z and just use the object's rotate transform to do the rest? That's how Blender's cone primitive spawns anyhow.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2249
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: Support of primitives like Spheres or Cylinders possible

Postby B.Y.O.B. » Wed Aug 15, 2012 10:47 am

Btw. I'd rather have a tickbox in the object tab that says something like "export as x primitive" than that name-stuff from Blendigo.
User avatar
B.Y.O.B.
 
Posts: 1911
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Next

Return to LuxBlend (Blender Exporter)

Who is online

Users browsing this forum: No registered users and 2 guests