def draw_custom_3d_elements(mode): """Get's updated custom 3D elements and draws them :param mode: drawing mode for custom elements (can be: 'Normal' or 'X-ray') :type mode: str """ if mode == "Normal": glEnable(GL_DEPTH_TEST) glClear(GL_DEPTH_BUFFER_BIT) else: # X-ray mode disable_depth_test() scs_globals = _get_scs_globals() # TERRAIN POINTS glPointSize(5.0) for tp_position, tp_color in _terrain_points_storage.get_positions_and_colors( ): _primitive.draw_point(tp_position, tp_color) glPointSize(1.0) (prefab_locators, collision_locators, model_locators) = _get_custom_visual_elements() # reset point size to 1.0 and set line width to 2.0 before drawing curves and lines glPointSize(1.0) glLineWidth(2.0) # CURVES AND LINES if scs_globals.display_connections: _connections_group_wrapper.draw(prefab_locators) # reset line width to 1.0 after drawing curves and lines glLineWidth(1.0) # LOCATORS if scs_globals.display_locators: # PREFAB LOCATORS if prefab_locators: for obj in prefab_locators.values(): _locators.prefab.draw_prefab_locator(obj, scs_globals) # COLLISION LOCATORS if collision_locators: for obj in collision_locators.values(): _locators.collider.draw_collision_locator(obj, scs_globals) # MODEL LOCATORS if model_locators: for obj in model_locators.values(): _locators.model.draw_model_locator(obj, scs_globals)
def draw_custom_3d_elements(mode): """Get's updated custom 3D elements and draws them :param mode: drawing mode for custom elements (can be: 'Normal' or 'X-ray') :type mode: str """ if mode == "Normal": glEnable(GL_DEPTH_TEST) glClear(GL_DEPTH_BUFFER_BIT) else: # X-ray mode disable_depth_test() scs_globals = _get_scs_globals() # TERRAIN POINTS glPointSize(5.0) for tp_position, tp_color in _terrain_points_storage.get_positions_and_colors(): _primitive.draw_point(tp_position, tp_color) glPointSize(1.0) (prefab_locators, collision_locators, model_locators) = _get_custom_visual_elements() # reset point size to 1.0 and set line width to 2.0 before drawing curves and lines glPointSize(1.0) glLineWidth(2.0) # CURVES AND LINES if scs_globals.display_connections: _connections_group_wrapper.draw(prefab_locators) # reset line width to 1.0 after drawing curves and lines glLineWidth(1.0) # LOCATORS if scs_globals.display_locators: # PREFAB LOCATORS if prefab_locators: for obj in prefab_locators.values(): _locators.prefab.draw_prefab_locator(obj, scs_globals) # COLLISION LOCATORS if collision_locators: for obj in collision_locators.values(): _locators.collider.draw_collision_locator(obj, scs_globals) # MODEL LOCATORS if model_locators: for obj in model_locators.values(): _locators.model.draw_model_locator(obj, scs_globals)
def draw_custom_3d_elements(mode): """Get's updated custom 3D elements and draws them :param mode: drawing mode for custom elements (can be: 'Normal' or 'X-ray') :type mode: str """ if mode == "Normal": glEnable(GL_DEPTH_TEST) glClear(GL_DEPTH_BUFFER_BIT) else: # X-ray mode disable_depth_test() context = bpy.context (prefab_locators, collision_locators, model_locators) = _get_custom_visual_elements() # PREFAB LOCATORS if context.scene.scs_props.display_locators: if prefab_locators: for obj in prefab_locators.values(): _locators.prefab.draw_prefab_locator(obj, context.scene.scs_props) # reset point size to 1.0 and set line width to 2.0 before drawing curves and lines glPointSize(1.0) glLineWidth(2.0) # CURVES AND LINES if context.scene.scs_props.display_connections: _connections_group_wrapper.draw(prefab_locators) # reset line width to 1.0 after drawing curves and lines glLineWidth(1.0) # COLLISION LOCATORS if context.scene.scs_props.display_locators: if collision_locators: for obj in collision_locators.values(): _locators.collider.draw_collision_locator( obj, context.scene.scs_props) # MODEL LOCATORS if context.scene.scs_props.display_locators: if model_locators: for obj in model_locators.values(): _locators.model.draw_model_locator(obj, context.scene.scs_props)
def draw_custom_3d_elements(mode): """Get's updated custom 3D elements and draws them :param mode: drawing mode for custom elements (can be: 'Normal' or 'X-ray') :type mode: str """ if mode == "Normal": glEnable(GL_DEPTH_TEST) glClear(GL_DEPTH_BUFFER_BIT) else: # X-ray mode disable_depth_test() context = bpy.context (prefab_locators, collision_locators, model_locators) = _get_custom_visual_elements() # PREFAB LOCATORS if context.scene.scs_props.display_locators: if prefab_locators: for obj in prefab_locators.values(): _locators.prefab.draw_prefab_locator(obj, context.scene.scs_props) # reset point size to 1.0 and set line width to 2.0 before drawing curves and lines glPointSize(1.0) glLineWidth(2.0) # CURVES AND LINES if context.scene.scs_props.display_connections: _connections_group_wrapper.draw(prefab_locators) # reset line width to 1.0 after drawing curves and lines glLineWidth(1.0) # COLLISION LOCATORS if context.scene.scs_props.display_locators: if collision_locators: for obj in collision_locators.values(): _locators.collider.draw_collision_locator(obj, context.scene.scs_props) # MODEL LOCATORS if context.scene.scs_props.display_locators: if model_locators: for obj in model_locators.values(): _locators.model.draw_model_locator(obj, context.scene.scs_props)