diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 6b2f66e5b4..c734aebdd4 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -57,10 +57,10 @@ class ShowBase: self.cam = self.camera.find('**/+Camera') # Set up a 2-d layer for drawing things behind Gui labels. - self.render2d = NodePath(setupPanda2d(self.win)) + self.render2d = NodePath(setupPanda2d(self.win, "render2d")) # Set up another 2-d layer for drawing the Gui labels themselves. - self.renderGui = NodePath(setupPanda2d(self.win)) + self.renderGui = NodePath(setupPanda2d(self.win, "renderGui")) # Set up an auxiliary 3-d layer for rendering floating heads # or other 3-d objects on top of text or widgets in the 2-d diff --git a/direct/src/showbase/showBase.cxx b/direct/src/showbase/showBase.cxx index 3d49b89a9c..ccd5f19413 100644 --- a/direct/src/showbase/showBase.cxx +++ b/direct/src/showbase/showBase.cxx @@ -157,11 +157,11 @@ PT(GraphicsWindow) make_graphics_window(GraphicsPipe *pipe, // can contain 2-d geometry and will be rendered on top of the // existing 3-d window. Returns the top node of the scene graph. NodePath -setup_panda_2d(GraphicsWindow *win) { +setup_panda_2d(GraphicsWindow *win, const string &graph_name) { PT(Node) render2d_top; - render2d_top = new NamedNode("render2d_top"); - Node *render2d = new NamedNode("render2d"); + render2d_top = new NamedNode(graph_name + "_top"); + Node *render2d = new NamedNode(graph_name); RenderRelation *render2d_arc = new RenderRelation(render2d_top, render2d); // Set up some overrides to turn off certain properties which we diff --git a/direct/src/showbase/showBase.h b/direct/src/showbase/showBase.h index a06b046074..15ff1aea78 100644 --- a/direct/src/showbase/showBase.h +++ b/direct/src/showbase/showBase.h @@ -34,7 +34,7 @@ EXPCL_DIRECT PT(GraphicsWindow) NodeAttributes &initial_state ); -EXPCL_DIRECT NodePath setup_panda_2d(GraphicsWindow *win); +EXPCL_DIRECT NodePath setup_panda_2d(GraphicsWindow *win, const string &name); EXPCL_DIRECT void add_render_layer(GraphicsWindow *win, Node *render_top, Camera *camera);