コード例 #1
0
def flattenMultitex(self, stateFrom = None, target = None,
                        useGeom = 0, allowTexMat = 0, win = None):
        from panda3d.core import MultitexReducer
        mr = MultitexReducer()
        if target != None:
            mr.setTarget(target)
        mr.setUseGeom(useGeom)
        mr.setAllowTexMat(allowTexMat)

        if win == None:
            win = base.win

        if stateFrom == None:
            mr.scan(self)
        else:
            mr.scan(self, stateFrom)
        mr.flatten(win)
コード例 #2
0
def flattenMultitex(self,
                    stateFrom=None,
                    target=None,
                    useGeom=0,
                    allowTexMat=0,
                    win=None):
    from panda3d.core import MultitexReducer
    mr = MultitexReducer()
    if target != None:
        mr.setTarget(target)
    mr.setUseGeom(useGeom)
    mr.setAllowTexMat(allowTexMat)
    if win == None:
        win = base.win
    if stateFrom == None:
        mr.scan(self)
    else:
        mr.scan(self, stateFrom)
    mr.flatten(win)
    return
コード例 #3
0
    def __init__(self):
        ShowBase.__init__(self)
        base.win.set_clear_color((0, 0, 0, 0))
        simplepbr.init()
        self.multitex_reducer = MultitexReducer()

        #load textures
        self.textures = {}
        texture_files = "plaid", "shirtnjeans", "jacket"
        for file in texture_files:
            self.textures[file] = loader.loadTexture(
                "textures/{}.png".format(file))

        # camera/control
        self.cam_pivot = NodePath("cam pivot")
        self.cam_pivot.reparentTo(render)
        base.cam.reparent_to(self.cam_pivot)
        base.cam.set_pos(0, -2.7, 1.8)
        self.cam_pivot.set_h(180)
        self.cam_pivot.set_y(0.2)
        self.move_speed = 0.5
        self.zoom_speed = 0.5
        self.last_mouse = [0, 0]
        self.accept("wheel_up", self.zoom_in)
        self.accept("wheel_down", self.zoom_out)
        self.taskMgr.add(self.update_camera)

        # sliders
        self.sliders = {}
        self.y_pos = 0.9

        # jan model
        self.jan = Actor(
            {
                "body": "jan/jan.bam",
                "palisa": "jan/acc/palisa-mije.bam",
                "hair": "jan/acc/hair_raz.bam",
                "clothing": "jan/clothing.bam",
            }, {
                "body": {},
                "palisa": {},
                "hair": {},
                "clothing": {},
            })
        self.jan.attach("hair", "body", "head")
        self.jan.attach("palisa", "body", "waist")
        self.jan.attach("clothing", "body", "root")
        self.jan.play("loop")
        self.jan.setTwoSided(True)
        self.jan.hide_part("palisa")
        self.make_sliders(self.jan)
        #self.jan.flatten_strong()
        #self.jan.post_flatten()
        #self.multitex_reducer.scan(self.jan)
        #self.multitex_reducer.flatten(base.win)

        self.jan.reparent_to(render)
        self.jan.set_transparency(True)

        # talk
        gender = "mije"  #meli
        self.speech = Speech(loader.loadSfx("toki-{}-a.wav".format(gender)))
        self.speech.say("to ki")
        self.speech.say("mi to ki po na")
        self.speech.say("mi o li n si na")
        self.taskMgr.add(self.speech.update)

        self.light_scene()
        render.ls()
        render.analyze()