Skip to content

Instantly share code, notes, and snippets.

@ronyx69
ronyx69 / TransparentSelectors.cs
Last active November 14, 2025 21:05
Source code of the transparent selectors mod.
using ColossalFramework.IO;
using ColossalFramework.UI;
using ICities;
using System;
using System.IO;
using System.Reflection;
using System.Xml.Serialization;
using UnityEngine;
namespace TransparentSelectors

Maya Scripts

About

These are some MEL scripts I've assigned to hotkeys. They are written or pieced together by me based on stuff I found in maya documentation, stackoverflow, forums, etc., or my own guesswork or trial and error. I'm sure there are plenty of weird edge cases where some scripts don't work or break somehow, I fix them as I discover them. The list looks longer than it really is, because many scripts have copies for each axis, some for +/- on each axis as well. Also some scripts depend on the presence of others, it should be mentioned in the description of each script if so.

My current hotkey sheet can be seen here (source is here) and you can make your own using my templates which are explained in this video.

I recommend [Auto

<html><head><title>  ​​</title><style>
div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { margin: 0; padding: 0; }
ul { list-style-type: none; }
body {
background-color: #252525;
color: #a0a0a0;
font-family: 'Segoe UI', sans-serif;
font-weight: 400;
font-size: 0.85vw;
line-height: 0.97vw;
<html><head><title>  ​​</title><style>
div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { margin: 0; padding: 0; }
ul { list-style-type: none; }
body {
background-color: #252525;
color: #a0a0a0;
font-family: 'Segoe UI', sans-serif;
font-weight: 400;
font-size: 0.85vw;
line-height: 0.97vw;
@ronyx69
ronyx69 / Relight.cs
Last active July 28, 2023 01:56
Source code for Relight mod. Rebalanced and customizable lighting and tonemapping. UI / saving and preset system by Simon Royer. Shadow bias change by saki7. Shadow smoothing change by TPB.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICities;
using UnityEngine;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Xml.Serialization;
@ronyx69
ronyx69 / AnimUV_Scripts.cs
Last active April 10, 2023 12:33
Scripts for saving AnimUV params in props. (Added modless shader parameter saving method by boformer.)
// Anim UV Scripts
// Create scrolling or multi-frame animations for props.
// Run in asset editor and see effects in real time.
// Animated faces must be vertex painted black! The rest reimains white.
// Shades of gray animate slower, don't use unless you know what you're doing.
// Google how to do vertex color painting in your 3d software of choice!
@ronyx69
ronyx69 / Realtime.cs
Last active August 31, 2022 15:31
Source code for Realtime mod. Ingame texture and mesh replacement. UI by Simon Royer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using System.IO;
using ColossalFramework.IO;
using ObjUnity3D;
using ICities;
@ronyx69
ronyx69 / PropRotating_Script.cs
Last active May 29, 2022 16:00
Script for saving PropRotating params in props. (Added modless shader parameter saving method by boformer.)
// Prop Rotating Script
// Control rotation axis, pivot and speed.
// Run in asset editor and see effects in real time.
// Animated faces must be vertex painted black! The rest reimains white.
// Google how to do vertex color painting in your 3d software of choice!
// The LODs are not rotating, they are like regular props.
@ronyx69
ronyx69 / replace_net_with_net.cs
Last active May 18, 2022 17:57
Replace target networks with replacement networks. Could break everything idk.
// replace all target nets with replacement net
var target = PrefabCollection<NetInfo>.FindLoaded("Pedestrian Connection Surface");
var replacement = PrefabCollection<NetInfo>.FindLoaded("Pedestrian Connection");
var b = NetManager.instance.m_segments.m_buffer;
for(var i=0;i<b.Length;i++) if(b[i].m_flags!=0) if(b[i].Info==target) b[i].Info=replacement;
var b2 = NetManager.instance.m_nodes.m_buffer;
for(var i=0;i<b2.Length;i++) if(b2[i].m_flags!=0) if(b2[i].Info==target) b2[i].Info=replacement;
for(var i=0;i<b.Length;i++) if(b[i].m_flags!=0) NetManager.instance.UpdateSegment((ushort)i);
@ronyx69
ronyx69 / PropBufferReadSet.cs
Last active July 18, 2021 09:57
Reads the prop buffer and generates a script to set it. Intended for reading/setting props for buildings in the asset editor. Generated example below the actual script.
// You must place the exact amount of props (any kind of props anywhere) before running the prop set script, otherwise it will not work properly.
// Generate a script to place props, located in local addons folder.
var s = "PropInstance[] nb = new PropInstance[65536];\n\n";
var buffer = PropManager.instance.m_props.m_buffer;
for(var i = 0; i < buffer.Length; i++) if (buffer[i].m_flags!=0) {
s = s + "nb[" + i + "].Angle = " + buffer[i].Angle + "f;\n";
s = s + "nb[" + i + "].Blocked = " + buffer[i].Blocked.ToString().ToLower() + ";\n";