Skip to content

Instantly share code, notes, and snippets.

View mrbbbaixue's full-sized avatar
:electron:
ヾ(^▽^*)))

MrBBBaiXue mrbbbaixue

:electron:
ヾ(^▽^*)))
View GitHub Profile
export var viewportResizeStanddown = 0.5
var viewportResizeCounter = 0.0
signal settingsChanged()
signal particlesSettingsChanged()
signal removeGpuParticles()
func forbidParticles(time):
particlesForbiddenCounter = time
particlesForbidden = true
@WolfgangSenff
WolfgangSenff / gist:0a9c1d800db42a9a9441b2d0288ed0fd
Last active May 31, 2024 01:55
GDScript 1.0 to 2.0 Beginner Friendly Conversion Guide
Beginner-friendly GDScript 1 to GDScript 2 Conversion Guide
First and foremost, this should not be considered a replacement for the official migration guide,
found at https://docs.godotengine.org/en/latest/tutorials/migrating/upgrading_to_godot_4.html!
Instead, this document is intended to be a friendly guide to helping you upgrade your projects from
GDScript 1 to 2. To do this, I'm going to list the most common conversions I've run into while upgrading
a few of my games and tools. This document is written as of the first release candidate version of Godot 4.0.
The first thing to do when converting a project (no need if you're starting from new) is to either have your
project in source control, or make a duplicate of your entire project's folder and rename it. This will
@imjp94
imjp94 / build.gd
Last active January 10, 2023 18:21
Build script to help exporting Godot project.
tool
extends SceneTree
const PLATFORM_ANDROID = "Android"
const PLATFORM_HTML5 = "HTML5"
const PLATFORM_IOS = "iOS"
const PLATFORM_LINUX = "Linux/X11"
const PLATFORM_MAC = "Mac OSX"
const PLATFORM_UWP = "UWP"
const PLATFORM_WINDOWS = "Windows Desktop"
@Arnklit
Arnklit / generate_plane.gd
Created March 16, 2022 06:56
Subdivided Plane Set as Lod Levels in Godot 4.0
@tool
extends MeshInstance3D
@export var generate := false:
set(v):
gen_mesh()
@export_range(0, 10) var subdivisions := 5
@export var size := 8.0

Godot dotnet6 branch notes

Update 22/04/22

I've managed to get Windows MSVC editor builds working about as well as Linux builds on my fork: https://github.com/lewiji/godot/tree/dotnet6

This fork includes patches mentioned in the details below for libicu compatibility, as well as specific fixes for MSVC compatibility.

I've also set up Github CI builds there which should be working for both Linux and Windows editors (unsure about export templates though at least the Linux ones are building currently).

@fire
fire / gltf_merge_anim.py
Created March 3, 2022 07:07 — forked from scurest/gltf_merge_anim.py
Quick code to convert a glTF with multiple non-overlapping animations to one with a single animation.
#!/bin/env python
"""Merge mutiple glTF 2.0 animations into one."""
import json
import sys
def merge(gltf):
# Maps (node, path) to (input, output, interpolation)
target_to_sampler = {}
for animation in gltf.get('animations', []):
for channel in animation['channels']:
@inc0der
inc0der / basic_fps_controller.gd
Last active October 12, 2022 05:34
Basic FPS Controller for Godot 4
# For Godot 4 Alpha 2
# The head node should contain the camera, flashlight and other things that require a pivot/rotation
class_name BasicFpsController
extends CharacterBody3D
@export var MOVE_SPEED := 4.0
@export var JUMP_FORCE := 4.5
@export var SPRINT_SPEED := 6.0
@wojtekpil
wojtekpil / hterrain_enhanced.shader
Created July 28, 2021 12:59
Hterrain enhanced shader for terrain (Classic4)
shader_type spatial;
render_mode cull_back,blend_mix, diffuse_burley, specular_schlick_ggx;
// This is the reference shader of the plugin, and has the most features.
// it should be preferred for high-end graphics cards.
// For less features but lower-end targets, see the lite version.
uniform sampler2D u_terrain_heightmap;
uniform sampler2D u_terrain_normalmap;
// I had to remove `hint_albedo` from colormap because it makes sRGB conversion kick in,
@wojtekpil
wojtekpil / hterrain_detail_enhanced.shader
Last active October 11, 2023 19:14
Hterrain enhanced shader for detail layers
shader_type spatial;
render_mode cull_disabled, blend_mix,diffuse_burley, specular_schlick_ggx;
uniform sampler2D u_terrain_heightmap;
uniform sampler2D u_terrain_detailmap;
uniform sampler2D u_terrain_normalmap;
uniform sampler2D u_terrain_globalmap : hint_albedo;
uniform mat4 u_terrain_inverse_transform;
uniform mat3 u_terrain_normal_basis;
# MIT LICENSE
# Authored by iFire#6518 and alexfreyre#1663
# This code ONLY apply to a mesh and simulations with ONLY the same vertex number
import bpy
#Converts a MeshCache or Cloth modifiers to ShapeKeys
frame = bpy.context.scene.frame_start
for frame in range(bpy.context.scene.frame_end + 1):
bpy.context.scene.frame_current = frame