Skip to content

Instantly share code, notes, and snippets.

View DarthMoulByte's full-sized avatar

DarthMoulByte

View GitHub Profile
@DarthMoulByte
DarthMoulByte / PressedButton.cs
Created August 3, 2020 08:10 — forked from YamilEzequiel/PressedButton.cs
Event Button pressed Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
public class PressedButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public UnityEvent OnHold;
@DarthMoulByte
DarthMoulByte / object_boolean_tools.py
Created June 26, 2020 20:39 — forked from derappelt/object_boolean_tools.py
Bool Tools Addon for Blender 2.8
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@DarthMoulByte
DarthMoulByte / gist:54469a8a38563b32b257a4b7c92c7b2e
Created February 10, 2020 09:50
Visual Studio 2019 Product Key
Visual Studio 2019 Enterprise
BF8Y8-GN2QH-T84XB-QVY3B-RC4DF
Visual Studio 2019 Professional
NYWVH-HT4XC-R2WYW-9Y3CM-X4V3Y
// This Editor extension adds a Open Terminal shortcut and menu item to the unity editor.
// Created by 45Ninjas.
// Works for unity 2019.3 running on Linux with Gnome 3.x.
// You should be smart enough to make it work for other versions or operating systems.
using System.Diagnostics;
using UnityEngine;
using UnityEditor;
using UnityEditor.ShortcutManagement;
@DarthMoulByte
DarthMoulByte / .Windows Optimization.md
Created September 23, 2019 03:49 — forked from imba-tjd/.Windows Optimization.md
记录我使用的软件和优化Windows的操作
@DarthMoulByte
DarthMoulByte / LICENCE SUBLIME TEXT
Created July 19, 2019 02:33
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@DarthMoulByte
DarthMoulByte / randomGroupObject.py
Created July 16, 2019 13:50 — forked from p2or/randomGroupObject.py
blender-selectRandomObjectInGroup
import bpy
from random import choice
scene = bpy.context.scene
ob = bpy.context.object
random_group = choice(ob.users_group)
obs = random_group.objects[:]
obs.remove(ob)
import bpy
obj = bpy.context.object
bpy.ops.object.modifier_add(type='SUBSURF')
for mod in obj.modifiers:
if mod.type == "SUBSURF":
obj.modifiers[mod.name].levels = 1
bpy.ops.object.modifier_apply(apply_as='DATA', modifier=mod.name)
# for http://blender.stackexchange.com/questions/32787/example-of-creating-and-setting-a-cycles-material-node-with-the-python-api
import bpy
# get the material
mat = bpy.data.materials['Material']
# get the nodes
nodes = mat.node_tree.nodes
# clear all nodes to start clean
import bpy
import random
def random_floats(min, max, size):
return [random.uniform(min, max) for _ in range(size)]
# define a animation length
length = 10
# create a list, which contains 10 random x values