Skip to content

Instantly share code, notes, and snippets.

@ikrima
ikrima / generate_python_intellisense.py
Created May 1, 2018 06:08
generate_python_intellisense.py
def gen_intellisense_stubs():
import pystubgen
import inspect
# This only traverses objects defined in the module
source = pystubgen.make_source(ue)
# Need to manually get freeform functions in module
functions_list = [o[1] for o in inspect.getmembers(ue) if inspect.isroutine(o[1])]
funcDefs = '\n'.join([pystubgen.make_source(funcObj) for funcObj in functions_list])
@ikrima
ikrima / Adding-Selective-lightbaking.patch
Created May 1, 2017 20:23
Selective Light Baking UE4 4.15
From e79d15122ffd2ac59170385afc858e90f9996eed Mon Sep 17 00:00:00 2001
From: ikrima <contact@ikrima.com>
Date: Thu, 16 Mar 2017 07:03:25 -0700
Subject: [PATCH] Adding selective lightbaking
-Mainly just piggybacked off existing functionality using FLightingBuildOptions
-Main thing was adding ability to pipe that data struct to the EditorBuildLighting command
& augmenting the ShouldOperateOnLevel() call to take into account FLightingBuildOptions
---
.../Editor/UnrealEd/Private/EditorBuildUtils.cpp | 49 ++++++++++++++--------
@ikrima
ikrima / build.cs
Created April 6, 2017 20:17
4.15 UE4 Optimized Build Rules
public BBR(TargetInfo Target)
{
//Config
//BuildConfiguration.RelativeEnginePath = /* ...*/;
//Debug
//---BuildConfiguration.bOmitPCDebugInfoInDevelopment = true /* d=false */;
//BuildConfiguration.bSupportEditAndContinue = false /* d=false */;
//BuildConfiguration.bDisableDebugInfoForGeneratedCode = true /* d=true */;
//BuildConfiguration.bAllowLTCG = false /* d=false */;
@ikrima
ikrima / USF-SyntaxHighlighting.reg
Created March 14, 2017 04:46
Enable VS2015 syntax highlighting for .usf files
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Languages\File Extensions\.usf]
"HLSLFile"=dword:00000001
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"
//Color balls with spherical falloff
//Lerp between start to end colors
float distToSphere = distance(inPixelWpos, inSphereCenterWpos);
float alpha = saturate(distToSphere / sphereRadius);
float3 outColor = lerp(StartColor, EndColor, alpha);
//Determine falloff power to sphere radius
float falloff = saturate(falloffScale * (alpha - 0.5) + 0.5 - falloffBias);
@ikrima
ikrima / UE4 Animation Subsystem Architecture
Last active November 23, 2023 03:18
Mapping Out The UE4 Animation Architecture Flow
Animation Subsystem
AnimInstance is the runtime animation class that maintains runtime data & plays shit
- This is the parent class of the animation blueprint
- Get Bone Transforms from a specific time t:
○ Sequence->GetAnimationPose(Output.Pose, Output.Curve, FAnimExtractContext(CurrentTime, Sequence->bEnableRootMotion));
UAnimationAsset is the classes that contain the actual data and also calculates bones & curves
- UAnimSequence
@ikrima
ikrima / PlayLevel.cpp
Last active December 12, 2015 15:55
Keep Editor window alive during VR Preview
if (bUseVRPreviewForPlayWorld && GEngine->HMDDevice.IsValid())
{
GEngine->HMDDevice->EnableStereo(true);
// minimize the root window to provide max performance for the preview.
TSharedPtr<SWindow> RootWindow = FGlobalTabmanager::Get()->GetRootWindow();
if (RootWindow.IsValid())
{
//////////////////////////////
//TODO: ikrimae: Pipe disabling this based on a config variable. So far hasn't crashed the editor but need stability testing & also it's a perf hit
@ikrima
ikrima / UE4 Test Configuration Packaging
Created June 13, 2015 00:30
How to package a Test Configuration in UE4
go to your UE4/Engine/Build/Binaries folder, and run the following:
RunUAT BuildCookRun -project="F:\UE4\MyHotProject\MyHotProject.uproject" -windows-noeditor -cook -stage -pak -package -clientconfig=Test
// Spherical Gaussian Power Function float pow(float x, float n)
{
n = n * 1.4427f + 1.4427f; // 1.4427f --> 1/ln(2)
return exp2(x * n - n);
}
@ikrima
ikrima / gist:5568c60d812a2a593c71
Created May 16, 2015 10:07
Alembic Tangent Calculation
//Split Normals & UVs
//NOTE: ikrimae: THIS HAS TO HAPPEN AFTER UVS, NORMALS, POSITIONS ELSE HAS BEEN COMPUTED
//TODO: ikrimae: this is horrible; clean up into something not convoluted
{
//For easy debugging
struct SplitVertex {
UINT32 vertIdx;
UINT32 vertFaceIdx;
V3f pos;