This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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(ind) { | |
| static __arr = []; | |
| var _i=1; repeat(argument_count-1) { | |
| __arr = argument[_i]; | |
| _i++} | |
| var _struct = constructor_call_ext(ind, __arr); | |
| array_resize(__arr, 0) | |
This file contains hidden or 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
| new Benchmark("array_contains_not", [ | |
| new TestCase("manually checked for()", function(iterations) { | |
| repeat (iterations) { | |
| var result = func(testArray, default_value); | |
| } | |
| }, | |
| function(){ | |
| //initiallizer (is not accounted for in the benchmark test) | |
| default_value = undefined; | |
This file contains hidden or 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
| Benchmarks = [ | |
| new Benchmark("2D Data foreach (full)", [ | |
| new TestCase("Array", function(iterations) { | |
| var _i=0; repeat(iterations){ | |
| arr.foreach(function(_cell, _x, _y){}, false) | |
| _i++} | |
| }, | |
| function(){ | |
| width = 32; |
This file contains hidden or 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 jsDoc | |
| /// @func buffer_create_from_surface | |
| /// @desc Creates a fixed-size buffer containing the pixel data from the given surface. The buffer size is determined | |
| /// by the surface's dimensions and format. The buffer is populated with the surface's pixel data starting at byte offset 0. | |
| /// @param {Id.Surface} _surf - The source surface from which to read pixel data. | |
| /// @returns {Id.Buffer} A buffer containing the surface's pixel data. | |
| #endregion | |
| function buffer_create_from_surface(_surf) { | |
| // Get surface properties | |
| var _width = surface_get_width(_surf); |
This file contains hidden or 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
| { | |
| "people":[ | |
| {"names":["grinning","grinning_face"],"surrogates":"\uD83D\uDE00","unicodeVersion":6.1}, | |
| {"names":["smiley"],"surrogates":"\uD83D\uDE03","unicodeVersion":6}, | |
| {"names":["smile"],"surrogates":"\uD83D\uDE04","unicodeVersion":6}, | |
| {"names":["grin"],"surrogates":"\uD83D\uDE01","unicodeVersion":6}, | |
| {"names":["laughing","satisfied"],"surrogates":"\uD83D\uDE06","unicodeVersion":6}, | |
| {"names":["face_holding_back_tears"],"surrogates":"\uD83E\uDD79","unicodeVersion":14}, | |
| {"names":["sweat_smile"],"surrogates":"\uD83D\uDE05","unicodeVersion":6}, | |
| {"names":["joy"],"surrogates":"\uD83D\uDE02","unicodeVersion":6}, |
This file contains hidden or 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 string_format_human_readable(_num) { | |
| if (_num == 0) return "zero"; | |
| static __ones = [ | |
| "", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", | |
| "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", | |
| "seventeen", "eighteen", "nineteen" | |
| ]; | |
| static __tens = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]; |
This file contains hidden or 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 CacheSystem() constructor { | |
| data = {}; | |
| static __string_hash = {} //explicetly used to improve the speed at which we hash strings | |
| static save = function(_value) { | |
| var _data = data; | |
| var _cache_ref_key_count = argument_count; | |
| var _last_index = _cache_ref_key_count-1; | |
| for(var _i=1; _i<_cache_ref_key_count; _i++) { |