Skip to content

Instantly share code, notes, and snippets.

View amelkor's full-sized avatar

Aleksei Melkor amelkor

  • Worldwide
View GitHub Profile
@amelkor
amelkor / blender_push_all_NLA.py
Created January 23, 2024 13:13
Pushes down all NLA actions
import bpy
for action in bpy.data.actions:
# Create a new NLA track for each action
bpy.context.view_layer.objects.active.animation_data_create()
track = bpy.context.view_layer.objects.active.animation_data.nla_tracks.new()
track.name = action.name
strip = track.strips.new(action.name, int(action.frame_start), action)
print('NLA pushed ' + str(strip))
/*
Realistic Water Shader for Godot 3.4
Modified to work with Godot 3.4 with thanks to jmarceno.
Copyright (c) 2019 UnionBytes, Achim Menzel (alias AiYori)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, W
@amelkor
amelkor / Windows Defender Exclusions for Developer.ps1
Created May 13, 2023 05:58 — forked from nerzhulart/Windows Defender Exclusions for Developer.ps1
Adds Windows Defender exclusions for developers (Visual Studio, JetBrains Rider, IntellIJ Idea, Git, MsBuild, dotnet, mono etc.)
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@amelkor
amelkor / .readme.md
Created May 13, 2023 05:09 — forked from andrew-raphael-lukasik/.SunController.cs.md
basic sun controller script

basic sun controller

@amelkor
amelkor / LayerChangeEditorWindow.cs
Last active May 11, 2023 02:38
In Unity3D changes layers of prefabs in selected folder including nested prefabs
using UnityEngine;
using UnityEditor;
using System.IO;
public class LayerChangeEditorWindow : EditorWindow
{
private int _oldLayerIndex;
private int _newLayerIndex;
private Object _folderObject;
@amelkor
amelkor / blender_loop_actions.py
Last active February 13, 2023 16:31
Blender loop actions which contain specified words by duplicating the first frame
import bpy
actions_to_check = ["Walk", "Wait", "Run"]
def duplicate_frames(action):
start_frame = action.frame_range[0]
end_frame = action.frame_range[1]
new_frame = end_frame + 1
for fcurve in action.fcurves:
fcurve.keyframe_points.insert(frame=new_frame, value=fcurve.evaluate(start_frame))
@amelkor
amelkor / Generate CSharp.groovy
Created December 29, 2022 09:39 — forked from maartenba/Generate CSharp.groovy
Rider generate C# from database
import com.intellij.database.model.DasTable
import com.intellij.database.util.Case
import com.intellij.database.util.DasUtil
/*
* Available context bindings:
* SELECTION Iterable<DasObject>
* PROJECT project
* FILES files helper
*/
@amelkor
amelkor / SerializedPropertyExtensions.cs
Created December 7, 2022 15:06 — forked from aholkner/SerializedPropertyExtensions.cs
Unity editor extension providing value get/set methods for SerializedProperty. This simplifies writing PropertyDrawers against non-trivial objects.
/* MIT License
Copyright (c) 2022 Alex Holkner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@amelkor
amelkor / blender_create_materials_from_textures_dir.py
Last active November 2, 2022 16:11
This script for Blender 3.0+ parses a directory with textures and creates materials with the corresponding textures assigned
import bpy
import os
textures_dir_path = 'D:/Textures'
use_fake_user = True
def run():
files = list_materials()
@amelkor
amelkor / GetBitFieldBits.cs
Created September 9, 2022 22:50
GetBitFieldBits
public static class Tools
{
public static byte GetBitFieldBits(byte value, byte start, byte length)
{
const byte bitMaxValue = 8;
return (byte)((value >> start) & (byte.MaxValue >> bitMaxValue - length));
}
}