示例#1
0
    def _toggle_scene_wireframe(self):
        self.scene_wireframe = not self.scene_wireframe

        if self.scene_wireframe:
            render.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MWireframe), 10)
        else:
            render.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MFilled), 10)
示例#2
0
    def _toggle_scene_wireframe(self):
        self.scene_wireframe = not self.scene_wireframe

        if self.scene_wireframe:
            render.setAttrib(
                RenderModeAttrib.make(RenderModeAttrib.MWireframe), 10)
        else:
            render.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MFilled),
                             10)
示例#3
0
    def toggleSceneWireframe(self):
        """ Toggles the scene rendermode """
        self.sceneWireframe = not self.sceneWireframe

        if self.sceneWireframe:
            render.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MWireframe), 10)
        else:
            render.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MFilled), 10)

        self.skybox.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MFilled), 20)
示例#4
0
    def toggleSceneWireframe(self):
        """ Toggles the scene rendermode """
        self.sceneWireframe = not self.sceneWireframe

        if self.sceneWireframe:
            render.setAttrib(
                RenderModeAttrib.make(RenderModeAttrib.MWireframe), 10)
            # render2d.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MWireframe), 10)
        else:
            render.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MFilled),
                             10)
            # render2d.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MFilled), 10)

        self.skybox.setAttrib(RenderModeAttrib.make(RenderModeAttrib.MFilled),
                              20)
示例#5
0
 def __init__(self):
     # Parent init.
     super(Picker, self).__init__()
     self.disableMouse()
     # Picker stuff.
     self.contact_margin = Vec3(0.01, 0.01, 0.01)
     self.parser = None
     self.marked = None
     self.attached_pairs = set()
     self.contacts = None
     self.contact_points = None
     self.contact_bottoms = None
     self.compound_components = []
     self.compound_objects = []
     self.joints = JointManager()
     self.wire_attrib = RenderModeAttrib.make(RenderModeAttrib.MWireframe,
                                              4.)
     self.attachment_colors = (Vec4(0.1, 0.1, 1.,
                                    1.), Vec4(0.1, 0.8, 0.1,
                                              1.), Vec4(1., 0.1, 1., 1.),
                               Vec4(1., 0.5, 0.1, 1.), Vec4(1., 1., 1., 1.))
     self.max_attach = 999
     self.permanent_events += ["mouse1"]
     # Make cursor dot.
     self.cursor = self._build_cursor("cross")
     s = 0.08
     self.cursor.setScale(s, s, s)
     self.cursor.setColor(1, 1, 1, 1)
     self.cursor.reparentTo(self.aspect2d)
     self.taskMgr.add(self.draw_cursor2d, "draw_cursor2d")
     self.permanent_tasks.append("draw_cursor2d")
示例#6
0
 def __init__(self):
     # Parent init.
     super(Picker, self).__init__()
     self.disableMouse()
     # Picker stuff.
     self.contact_margin = Vec3(0.01, 0.01, 0.01)
     self.parser = None
     self.marked = None
     self.attached_pairs = set()
     self.contacts = None
     self.contact_points = None
     self.contact_bottoms = None
     self.compound_components = []
     self.compound_objects = []
     self.joints = JointManager()
     self.wire_attrib = RenderModeAttrib.make(
         RenderModeAttrib.MWireframe, 4.)
     self.attachment_colors = (Vec4(0.1, 0.1, 1., 1.),
                               Vec4(0.1, 0.8, 0.1, 1.),
                               Vec4(1., 0.1, 1., 1.),
                               Vec4(1., 0.5, 0.1, 1.),
                               Vec4(1., 1., 1., 1.))
     self.max_attach = 999
     self.permanent_events += ["mouse1"]
     # Make cursor dot.
     self.cursor = self._build_cursor("cross")
     s = 0.08
     self.cursor.setScale(s, s, s)
     self.cursor.setColor(1, 1, 1, 1)
     self.cursor.reparentTo(self.aspect2d)
     self.taskMgr.add(self.draw_cursor2d, "draw_cursor2d")
     self.permanent_tasks.append("draw_cursor2d")
示例#7
0
def wire(folder, color=None, s=4):
    w = loader.loadModel(folder + "_wire.egg")
    d=5
    for child in w.getChildren():
        m = child.findMaterial("*")
        if not color == None:
            c = color
        elif not m == None:
            d=1
            c = (1,1,1,1)
        else:
            if color == None:
                c = (1,1,1,1)
            else:
                c = color
        child.node().setAttrib(RenderModeAttrib.make(d, s, False, c))

    m = loader.loadModel(folder + "_model.egg")
    return w, m