Text archives Help
- From:
- To:
- Subject: [Manta] r2331 - trunk/SwigInterface
- Date: Wed, 24 Sep 2008 13:40:20 -0600 (MDT)
Author: abe
Date: Wed Sep 24 13:40:19 2008
New Revision: 2331
Modified:
trunk/SwigInterface/manta.i
trunk/SwigInterface/objviewer.py
Log:
Added MeshTriangle.
M SwigInterface/objviewer.py
M SwigInterface/manta.i
Modified: trunk/SwigInterface/manta.i
==============================================================================
--- trunk/SwigInterface/manta.i (original)
+++ trunk/SwigInterface/manta.i Wed Sep 24 13:40:19 2008
@@ -247,6 +247,7 @@
#include <Model/Primitives/Sphere.h>
#include <Model/TexCoordMappers/UniformMapper.h>
#include <Model/Primitives/BumpPrimitive.h>
+#include <Model/Primitives/MeshTriangle.h>
%}
//%include <Model/Materials/OpaqueShadower.h>
@@ -271,6 +272,7 @@
%include <Model/Primitives/Sphere.h>
%include <Model/TexCoordMappers/UniformMapper.h>
%include <Model/Primitives/BumpPrimitive.h>
+%include <Model/Primitives/MeshTriangle.h>
///////////////////////////////////////////////////////////////////////////////
// Groups
Modified: trunk/SwigInterface/objviewer.py
==============================================================================
--- trunk/SwigInterface/objviewer.py (original)
+++ trunk/SwigInterface/objviewer.py Wed Sep 24 13:40:19 2008
@@ -39,6 +39,8 @@
filename = ""
ignore_vn = False
+default_material = None;
+triangle_type = MeshTriangle.KENSLER_SHIRLEY_TRI
# Re-create the default scene using the example texture.
def initialize_scene( frame, engine ):
@@ -53,7 +55,7 @@
print "File: " + filename
try:
- obj = manta_new( ObjGroup( filename ) )
+ obj = manta_new( ObjGroup( filename, default_material, triangle_type
) )
except InputError,e:
print "Error: " + e.message()
exit(1)
@@ -93,8 +95,9 @@
num_workers = 1
# Value of None indicates that a default will be used.
+ camera = "pinhole( -normalizeRays -createCornerRays )";
imagetype = None;
- shadows = None;
+ shadows = "noshadows";
imagetraverser = "tiled( -tilesize 8x8 -square )";
loadbalancer = None;
pixelsampler = None;
@@ -106,6 +109,7 @@
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["np=",
"file=",
+ "camera=",
"imagetype=",
"shadows=",
"imagetraverser=",
@@ -115,12 +119,13 @@
"ignore_vn"]
)
- except getopt.GetoptError:
+ except getopt.GetoptError,e:
+ print e
usage()
sys.exit(2)
global filename, ignore_vn
-
+
for o, a in opts:
if o in ("-n", "--np"):
try:
@@ -131,9 +136,13 @@
elif o in ("-f", "--file"):
filename = a
+
elif o in ("--ignore_vn"):
ignore_vn = True;
+ elif o in ("--camera"):
+ camera = str(a).replace(';',' ');
+
elif o in ("--imagetype"):
imagetype = str(a).replace(';',' ');
@@ -163,6 +172,16 @@
num_workers )
factory = Factory(app.frame.engine,True)
+
+ if (camera):
+ cam = factory.createCamera(camera);
+ if (not cam):
+ print "Invalid camera, choices:"
+ for key in factory.listCameras():
+ print key
+ sys.exit(2)
+ else:
+ app.frame.engine.setCamera(0,cam);
if (imagetype):
- [Manta] r2331 - trunk/SwigInterface, abe, 09/24/2008
Archive powered by MHonArc 2.6.16.