Sorry but I come with yet another trouble. Simple python script for new shape creation does not create new shape.
Please help with troubleshooting.
Details:
Nothing in erlang console.
W3D log window:
wpc_scripting_shapes:command/3: bad return value: {shape,
{shape_from_script,
{{command_rec,
[["type","py"],
["name","Test Shape"]],
"c:/Users/kav/Documents/new_shape_test/test_shape.py",
"py",[]},
[]}}}
test_shape.py: (should generate 2x2 cube)
test_shape.wscr:
type "py"
name ?__(1,"Test Shape")
Please help with troubleshooting.
Details:
Nothing in erlang console.
W3D log window:
wpc_scripting_shapes:command/3: bad return value: {shape,
{shape_from_script,
{{command_rec,
[["type","py"],
["name","Test Shape"]],
"c:/Users/kav/Documents/new_shape_test/test_shape.py",
"py",[]},
[]}}}
test_shape.py: (should generate 2x2 cube)
Code:
import w3d_e3d
import w3d_newshape
import sys
def mnewshape():
mesh = w3d_e3d.E3DMesh()
mesh.type = "polygon"
mesh.vs = [(-1,1,-1),(-1,1,1),(1,1,-1),(1,1,1),(-1,-1,-1),(-1,-1,1),(1,-1,-1),(1,-1,1)]
mesh.fs = [[0,1,2,3],[6,7,5,4],[1,0,4,5],[2,3,7,6],[0,2,6,4],[3,1,5,7]]
e3d_o = w3d_e3d.E3DObject()
e3d_o.obj = mesh
e3d_o.name = "test mesh"
nshp = w3d_newshape.NewShape()
nshp.prefix = "test"
nshp.obj = e3d_o
o = nshp.as_output_list()
o.write_list_out(sys.stdout)
w3d_main_function = mnewshape
test_shape.wscr:
type "py"
name ?__(1,"Test Shape")