"J. F. Miller" <jfm### [at] hotmailcom> wrote:
> I have been playing around with blender for a while now, and I'm looking for
> a tool that will let me export NURBS and Bezier Surfaces tp povray as
> mathmatical surfaces and not meshes. Does anyone know of such a tool? If
> not could anybody give me some hints on how I might write one.
>
> Thanks
>
> JFMILLER
J F
I am currently trying to do the same thing. I have Blender 2.41 and Python
2.40. I have so far found it impossible to access data about NURBS
objects. I wrote a little script to dump information about objects in the
scene. However, when it encounters anything that is a NURBS surface it
emits a type of 'NoneType' and no data about the object. I'm wanting to
export to RenderMan format but do not want everything to be a polygon mesh.
The script I wrote is here for you to have a play with:
#!BPY
# geodump script by Mark Thorpe. 14/02/2006
# version 0.1
# script was written on blender 2.41 with python 2.40
import Blender # top-level blender module
#PARAMETER DECLARATIONS#
children = Blender.Object.Get()
#FUNCTION DEFINITIONS#
def emit(str):
print("> " + str)
# list all the scene child objects and their respective lists of properties
(if any)
def main():
print("*** STARTING THE DUMP ***")
emitstr = "" # utility string
for child in children:
emit("0bject = : " + `child`)
emit("type = : " + `type(child.getData())`)
cproperties = child.getAllProperties()
materials = child.getMaterials(1)
emit("name = : " + child.getData(name_only=True))
emit("properties : ")
for cproperty in cproperties:
emit(" :" + cproperty.getName())
emit("materials : ")
for material in materials:
emit(" :" + `material`)
emit("data: ")
emit("drawType: " + `child.getDrawType()`)
emit("matrix: " + `child.getMatrix()`)
emit(`child.getData(name_only=False, mesh=True)`)
emit("n")
print("*** END OF THE DUMP ***")
main()
Regards
Mark T
Post a reply to this message
|