You've already forked godot
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:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user