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 os | |
import zipfile | |
def make_zipfile(output_filename, source_dir): | |
relroot = os.path.abspath(os.path.join(source_dir, os.pardir)) | |
with zipfile.ZipFile(output_filename, "w", zipfile.ZIP_DEFLATED) as zip: | |
for root, dirs, files in os.walk(source_dir): | |
zip.write(root, os.path.relpath(root, relroot)) | |
for file in files: | |
filename = os.path.join(root, file) |
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 stat | |
import os | |
import shutil | |
import datetime | |
LOCAL_HISTORY = ".local_history" | |
AUTO_PREFIX = ".version__" | |
NAMED_PREFIX = ".named__" | |
READONLY = 33060 | |
WRITABLE = 33206 |
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
-- Let's create a beacon for a unit in distress. | |
-- Frequency will be 40MHz FM (home-able by a Huey's AN/ARC-131) | |
-- The beacon they use is battery-powered, and only lasts for 5 min | |
local UnitInDistress = UNIT:FindByName("CRASHED HELICOPTER") | |
local UnitBeacon = UnitInDistress:GetBeacon() | |
-- Set the beacon and start it | |
UnitBeacon:RadioBeacon("MySoundFileSOS.ogg", 40, radio.modulation.FM, 20, 5*60) |
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
-- DCS lua | |
local tanker = GROUP:FindByName("TANKER") | |
local route = tanker:GetTaskRoute() | |
for _, each in pairs(route) do | |
tanker:I(each["x"]) | |
tanker:I(each["y"]) | |
end |
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
local recce = UNIT:FindByName("DRONE UNIT") | |
local lasing_drone = SPOT:New(recce) | |
local target = UNIT:FindByName("LASER TARGET") | |
lasing_drone:LaseOn(target, 1688, 600) | |
MESSAGE:New("Lasing Target!"):ToAll() |
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
--- | |
--- Generated by EmmyLua(https://github.com/EmmyLua) | |
--- Created by niels. | |
--- DateTime: 1/4/2022 3:35 PM | |
--- | |
local function split_string(str, delimiter) | |
local result = {}; | |
for match in (str ..delimiter):gmatch("(.-)"..delimiter) do | |
table.insert(result, match); |
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 pymel.core as pm | |
def get_shape_nodes(node, intermediate=False): | |
if pm.nodeType(node) == "transform": | |
shape_nodes = pm.listRelatives(node, shapes=True, path=True) | |
found_shape_nodes = [] | |
if shape_nodes is None: | |
return None |
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
load_hard_edges(hard_edge_info): | |
selection_list = om.MSelectionList() | |
dag_path = selection_list.getDagPath(0) | |
mfn_mesh = om.MFnMesh(dag_path) | |
# zip over the small 2 member lists to end up with 2 big lists. | |
edge_numbers, edge_hardness = zip(*hard_edge_info) | |
mfn_mesh.setEdgeSmoothings(edge_numbers, edge_hardness) | |
mfn_mesh.cleanupEdgeSmoothing() |
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 maya.api.OpenMaya as om | |
def save_hard_edges(): | |
selection_list = om.MSelectionList() | |
dag_path = selection_list.getDagPath(0) | |
edge_it = om.MItMeshEdge(dag_path) | |
hard_edge_info = [] | |
while not edge_it.isDone(): | |
# save a list of the edge number and a bool whether it's a soft edge |