1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-25 15:37:42 +00:00

Implemented skeleton visibility

Removed code visibility code from popup menu
This commit is contained in:
AndreaCatania
2017-11-22 22:29:27 +01:00
parent 20b07a1fb5
commit 63ec5823d1
9 changed files with 359 additions and 18 deletions

View File

@@ -1316,6 +1316,34 @@ void SkeletonSpatialGizmo::redraw() {
Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/skeleton");
Ref<Material> material = create_material("skeleton_material", gizmo_color);
SpatialMaterial *sm = Object::cast_to<SpatialMaterial>(material.ptr());
{ // Reset
Color c(sm->get_albedo());
c.a = 1;
sm->set_albedo(c);
}
if (sm) {
switch (SpatialEditor::get_singleton()->get_skeleton_visibility_state()) {
case 0: {
// Hidden
Color c(sm->get_albedo());
c.a = 0;
sm->set_albedo(c);
sm->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
} break;
case 1:
// Visible
sm->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, false);
sm->set_render_priority(SpatialMaterial::RENDER_PRIORITY_MIN);
sm->set_flag(SpatialMaterial::FLAG_DISABLE_DEPTH_TEST, false);
break;
case 2:
// x-ray
sm->set_on_top_of_alpha();
break;
}
}
Ref<SurfaceTool> surface_tool(memnew(SurfaceTool));