This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The EditorValidatorBase is a class which verifies that an asset meets a specific ruleset. | |
* It should be used when checking engine-level classes, as UObject::IsDataValid requires | |
* overriding the base class. You can create project-specific version of the validator base, | |
* with custom logging and enabled logic. | |
* | |
* C++ and Blueprint validators will be gathered on editor start, while python validators need | |
* to register themselves | |
*/ | |
UCLASS(Abstract, Blueprintable, meta = (ShowWorldContextPin)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unreal | |
@unreal.uclass() | |
class EditorValidatorConcrete(ue.EditorValidatorBase): | |
def __init__(self, *arg, **kwds): | |
super(EditorValidatorConcrete, self).__init__(*arg, **kwds) | |
@unreal.ufunction(override=True) | |
def validate_loaded_asset(self, asset, validation_errors): | |
self.asset_fails(asset, "asset failed", validation_errors) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EditorValidatorBase(Object): | |
r""" | |
* The EditorValidatorBase is a class which verifies that an asset meets a specific ruleset. | |
* It should be used when checking engine-level classes, as UObject::IsDataValid requires | |
* overriding the base class. You can create project-specific version of the validator base, | |
* with custom logging and enabled logic. | |
* | |
* C++ and Blueprint validators will be gathered on editor start, while python validators need | |
* to register themselves | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
// This behaviour disables 're-centering' on the Oculus Quest, | |
// instead forcing the camera origin to remain centered and | |
// facing the same direction within the Guardian boundaries, | |
// even between app restarts. | |
public class RecenterResetter : MonoBehaviour | |
{ | |
public OVRCameraRig CameraRig = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Playables; | |
using UnityEngine.Video; | |
public class PlayableVideoAsset : PlayableAsset | |
{ | |
public ExposedReference<VideoClip> Clip = new ExposedReference<VideoClip>(); | |
public float Offset; | |
private double _duration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Tri-Planar World Normal" { | |
Properties{ | |
_Color("Main Color", Color) = (1,1,1,1) | |
_Side("Side", 2D) = "gray" {} | |
_Top("Top", 2D) = "gray" {} | |
_Bottom("Bottom", 2D) = "gray" {} | |
_SideScale("Side Scale", Float) = 2 | |
_TopScale("Top Scale", Float) = 2 | |
_BottomScale("Bottom Scale", Float) = 2 | |
_BumpMapSide("Side Normal Map", 2D) = "bump" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Threading; | |
class BitmapEncoder | |
{ | |
public static void WriteBitmap(Stream stream, int width, int height, byte[] imageData) |