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
### CreateToggleShapekeys - By: Red#8479 | |
# To use this script simply select the object | |
# you would like to add a shapekey to to toggle | |
# it in games. This will automatically create a | |
# shapekey for you named `Toggle_`+[ObjectName] | |
import bpy | |
import bmesh | |
from mathutils import Vector | |
import numpy as np |
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
function __DeprocatedFunctions() { | |
static __struct = { | |
"achievement_available": achievement_available, | |
"achievement_get_challenges": achievement_get_challenges, | |
"achievement_get_pic": achievement_get_pic, | |
"achievement_increment": achievement_increment, | |
"achievement_load_friends": achievement_load_friends, | |
"achievement_load_leaderboard": achievement_load_leaderboard, | |
"achievement_load_progress": achievement_load_progress, | |
"achievement_login": achievement_login, |
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
# Purpose is to bind all materials to a single object to allow for importing into unity, as unity will not import a material if it's not actively used on a model, despite being in the files. | |
import bpy | |
def create_carrier_mesh(): | |
# Name for the carrier mesh | |
carrier_mesh_name = "Material_Carrier_Mesh" | |
# Create a new mesh and object for the carrier | |
mesh_data = bpy.data.meshes.new(carrier_mesh_name) |
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
#macro parent_constructor __parent_constructor(asset_get_index(_GMFUNCTION_)) | |
/// @ignore | |
function __parent_constructor(_ref) { | |
if (struct_exists(static_get(_ref), "__parent_constructor__")) return static_get(_ref).__parent_constructor__; | |
var _constructor = undefined; | |
//check to see if this is the constructor | |
var _tags = asset_get_tags(_ref, asset_script) | |
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
function serialize(_obj) { | |
if (is_handle(_obj) && script_exists(_obj)) return undefined; // strip functions as `undefined` | |
if (!is_array(_obj) && !is_struct(_obj)) return _obj; | |
// Check if it's an array or a plain object, then create a new instance accordingly | |
if (is_struct(_obj)) { | |
var _result = {}; | |
var _names = struct_get_names(_obj) | |
var _length = array_length(_names); | |
for (var _i=0; _i<_length; _i++) { |
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
show_debug_message("\n\n\n") | |
demo_view_pointer = dbg_view("Demo", true, 0, 0, display_get_gui_width(), display_get_gui_height()); | |
dbg_section("", true); | |
dbg_text_separator("Views"); | |
#region dbg_view | |
dbg_section("dbg_view", false); |
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
// 1. Upper Bound Positive (64-bit max positive value) | |
show_debug_message((0b0111111111111111111111111111111111111111111111111111111111111111 == __binaryTo64Bit("0b0111111111111111111111111111111111111111111111111111111111111111")) ? "Success" : $"{0b0111111111111111111111111111111111111111111111111111111111111111} != {__binaryTo64Bit("0b0111111111111111111111111111111111111111111111111111111111111111")}"); | |
// 2. Lower Bound Positive (64-bit min positive value) | |
show_debug_message((0b1 == __binaryTo64Bit("0b1")) ? "Success" : $"{0b1} != {__binaryTo64Bit("0b1")}"); | |
// 3. Upper Bound Negative (64-bit min negative value) | |
show_debug_message((0b1000000000000000000000000000000000000000000000000000000000000000 == __binaryTo64Bit("0b1000000000000000000000000000000000000000000000000000000000000000")) ? "Success" : $"{0b1000000000000000000000000000000000000000000000000000000000000000} != {__binaryTo64Bit("0b1000000000000000000000000000000000000000000000000000000000000000")}"); | |
// 4. Lower Bound Negative (64-bit max n |
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
#region GC Timer Internals | |
//Beta IDE v2023.600.0.368 Beta Runtime v2023.600.0.387 | |
// as of now, this number is 2 but might change in the future so best to calculate it on build, note this is not needed just increases accuracy | |
//forget the initial count as it builds new internals on first call | |
if (os_browser == browser_not_a_browser) gc_get_stats().num_objects_in_generation[0] | |
//find out the offset from simply running the function | |
var __gc_start = (os_browser != browser_not_a_browser) ? 0 : gc_get_stats().num_objects_in_generation[0] | |
global.__gc_log_offset = (os_browser != browser_not_a_browser) ? 0 : gc_get_stats().num_objects_in_generation[0]-__gc_start; | |
#endregion |
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
function constructor_call_ext(_func, _args) { | |
static __executors = (function(){ | |
var _struct = {}; | |
struct_set_from_hash(_struct, 0, function(_func, _args) { return new _func( ); }); | |
struct_set_from_hash(_struct, 1, function(_func, _args) { return new _func( _args[0] ); }); | |
struct_set_from_hash(_struct, 2, function(_func, _args) { return new _func( _args[0], _args[1] ); }); | |
struct_set_from_hash(_struct, 3, function(_func, _args) { return new _func( _args[0], _args[1], _args[2] ); }); | |
struct_set_from_hash(_struct, 4, function(_func, _args) { return new _func( _args[0], _args[1], _args[2], _args[3] ); }); | |
struct_set_from_hash(_struct, 5, function(_func, _args) { return new _func( _args[0], _args[1], _args[2], _args[3], _args[4] ); }); | |
struct_set_from_hash(_struct, 6, function(_func, _args) { return new _func( _args[0], _args[1], _args[2], _args[3], _args[4], _args[5] ); }); |
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
function hash_of_doom(_funcArr) { | |
static __executors = (function(){ | |
var _struct = {}; | |
struct_set_from_hash(_struct, 0, function(_funcArr) { }); | |
struct_set_from_hash(_struct, 1, function(_funcArr) { _funcArr[0]() }); | |
struct_set_from_hash(_struct, 2, function(_funcArr) { _funcArr[0](); _funcArr[1]() }); | |
struct_set_from_hash(_struct, 3, function(_funcArr) { _funcArr[0](); _funcArr[1](); _funcArr[2]() }); | |
struct_set_from_hash(_struct, 4, function(_funcArr) { _funcArr[0](); _funcArr[1](); _funcArr[2](); _funcArr[3]() }); | |
struct_set_from_hash(_struct, 5, function(_funcArr) { _funcArr[0](); _funcArr[1](); _funcArr[2](); _funcArr[3](); _funcArr[4]() }); | |
struct_set_from_hash(_struct, 6, function(_funcArr) { _funcArr[0](); _funcArr[1](); _funcArr[2](); _funcArr[3](); _funcArr[4](); _funcArr[5]() }); |