Ejemplo n.º 1
0
        help="incline change throughout spiral in degrees (ex 38:45)")
    parser.add_option(
        "-p",
        "--points",
        action="store",
        type="string",
        dest="pointsFile",
        default="",
        help=
        "Include points file as center points of spirals (no file defaults to center of model)"
    )
    (options, args) = parser.parse_args()
    print options
    print args

    scene_root = scene_registry.scene_root(options.scene)
    #
    scene_path = scene_root + "/" + options.xml
    if not os.path.exists(scene_path):
        print "Cannot find file: ", scene_path
        sys.exit(-1)

    #output frame size
    NI, NJ = 1280, 720

    # ensure trajectory images can be written out
    trajDir = os.getcwd() + "/spiral/"
    if not os.path.exists(trajDir):
        os.mkdir(trajDir)
    camDir = os.getcwd() + "/spiral_cams/"
    if not os.path.exists(camDir):
Ejemplo n.º 2
0
from optparse import OptionParser

####################################################### 
# handle inputs                                       #
#scene is given as first arg, figure out paths        #
parser = OptionParser()
parser.add_option("-s", "--scene", action="store", type="string", dest="scene", help="specify scene name")
parser.add_option("-x", "--xmlfile", action="store", type="string", dest="xml", default="uscene.xml", help="scene.xml file name (model/uscene.xml, model_fixed/scene.xml, rscene.xml)")
parser.add_option("-g", "--gpu",   action="store", type="string", dest="gpu",   default="gpu1", help="specify gpu (gpu0, gpu1, etc)")
parser.add_option("-m", "--maxFrames", action="store", type="int", dest="maxFrames", default=500, help="max number of frames to render")
parser.add_option("-r", "--radius", action="store", type="float", dest="radius", default=1.0, help="distance from cam center to model center")
(options, args) = parser.parse_args()
print options
print args

scene_root = scene_registry.scene_root( options.scene ); #
model_name = options.xml
if not os.path.exists(scene_root + "/" + model_name):
  print "Cannot find file: ", scene_root+"/"+model_name
  sys.exit(-1) 
GPU = options.gpu;
MAX_FRAMES = options.maxFrames
NI=1280
NJ=720
#################################

#should initialize a GPU
os.chdir(scene_root);
scene_path = os.getcwd() + "/" + model_name
scene = boxm2_scene_adaptor(scene_path, GPU);  
(sceneMin, sceneMax) = scene.bounding_box(); 
Ejemplo n.º 3
0
#scene is given as first arg, figure out paths        #
parser = OptionParser()
parser.add_option("-s", "--scene", action="store", type="string", dest="scene", help="specify scene name")
parser.add_option("-x", "--xmlfile", action="store", type="string", dest="xml", default="model/uscene.xml",help="model/scene name (eg model/uscene.xml))")
parser.add_option("-t", "--type",  action="store", type="string", dest="type",  default="all",  help="specify changetype ("", raybelief, twopass)")
parser.add_option("-n", "--nvals", action="store", type="string", dest="nvals", default="135",  help="specify n values (1, 13, 35, 135, etc)")
parser.add_option("-g", "--gpu",   action="store", type="string", dest="gpu",   default="gpu1", help="specify gpu (gpu0, gpu1, etc)")
parser.add_option("-o", "--gt",    action="store_true",           dest="gt",    default=False,  help="only render ground truth images")
parser.add_option("-i", "--imgType", action="store", type="string", dest="imgType", default="png", help="change image types (png, tif, tiff, etc)")
(options, args) = parser.parse_args()
print options
print args

#scene name, model name
scene_name = options.scene              #
scene_root = scene_registry.scene_root( scene_name ); #
MODEL      = options.xml.split("/")[0]

#set gpu
GPU = options.gpu

#n values to check for
ns = []
for n in options.nvals:
  ns.append( int(n) )

#change types
if options.type == "all":
  CHANGETYPES = [ "", "raybelief", "twopass" ] 
elif options.type in ["", "raybelief", "twopass"] :
  CHANGETYPES = [ options.type ]