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
def cook_top_network(hip_filepath: str, top_node_path: str, parm_dict: Dict[str, Any]): | |
print(f'Process ID: {os.getpid()}') | |
import hou | |
print(f'Loading hip file: {hip_filepath}') | |
hou.hipFile.load(hip_filepath) | |
top_node: hou.TopNode = hou.node(top_node_path) | |
assert isinstance(top_node, hou.TopNode) | |
for parm_name, value in parm_dict.items(): | |
print(f'setting {parm_name} to {value}') |
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
def road_length_to_all_possible_curve_sequences(curve_length_by_type: list[int], max_road_length): | |
'''对每种道路长度,生成可能的曲线组合序列。 | |
Args: | |
curve_length_by_type (list[int], optional): 每种类型曲线的长度。 | |
max_road_length (int): 最大道路长度。 | |
Returns: | |
road_length_to_last_possible_curve_type_list (dict[int, list[int]]):每种长度的道路最后一段曲线的类型。 | |
''' | |
# curve_length_by_type[curve_type_index] = curve_length |
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
using System; | |
using System.Reflection; | |
using UnityEditor; | |
using UnityEditor.AssetImporters; | |
using UnityEngine; | |
namespace Hwei.AssetTools | |
{ | |
[CustomEditor(typeof(TextureImporter))] | |
public class CustomTextureImporter : Editor |
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 spRunOpList(opList) { | |
const ERROR_CODE = { | |
BAD_REQUEST: 400, | |
NOT_FOUND: 404, | |
CONFLICT: 409, | |
NOT_ACCEPTED: 499 | |
} | |
const collection = getContext().getCollection() | |
const collectionLink = collection.getSelfLink() |
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
using UnityEngine; | |
using UnityEditor; | |
using System.Collections.Generic; | |
using System.IO; | |
public class BakeSpriteAtlas : EditorWindow | |
{ | |
const string TITLE = "Bake Sprite Atlas"; | |
[MenuItem ("Window/" + TITLE)] |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#define STBI_ONLY_PNG | |
#define STB_IMAGE_IMPLEMENTATION | |
#include "stb_image.h" | |
#define STB_IMAGE_WRITE_IMPLEMENTATION | |
#include "stb_image_write.h" |
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
using UnityEngine; | |
using UnityEditor; | |
using System.Linq; | |
public class CombineTextureFrames : ScriptableWizard { | |
public Texture2D[] textures; | |
public Vector2 frameSize; | |
public Vector2 layout; |
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
Shader "G42/vertex_color" { | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
Lighting Off | |
BindChannels { | |
Bind "Color", color | |
} | |
Pass { | |
SetTexture[_] { |
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
using UnityEngine; | |
using UnityEditor; | |
public class MatcapToCubemap : ScriptableWizard { | |
public Texture matcap; | |
public float emissionScale = 1f; | |
public int size = 256; | |
void OnWizardUpdate () { | |
this.isValid = this.matcap != null; |
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
// C++ 32bit FNV-1a string hashing. | |
// Support both compile-time and runtime calulations. | |
// This implementation also hashes '\0' terminator. | |
// Requires a compiler with C++11 support. | |
// See main for examples. | |
#include <iostream> | |
namespace hardrock |
NewerOlder