- Put
mayapy
on Path - Open a cmd as admin
- run
mayapy -m ensurepip --default-pip
- run
mayapy -m pip install --upgrade pip
- run
mayapy -m pip install ipython==5.7.0
- delete
C:\Program Files\Autodesk\Maya2018\Python\Lib\site-packages\_scandir.pyd
. it's build against original python release version. - test
mayapy -c "from IPython import embed; embed()"
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
''' | |
export camera standalone | |
1. put in `C:/Users/<user>/Documents/maya/scripts` | |
2. open maya and select the camera in outliner | |
3. menu 'custom->Export Selected Camera' | |
''' | |
from maya import cmds | |
from maya import mel | |
def make_kwargs(overrides, **kwargs): |
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 <cassert> | |
#include <iostream> | |
#include <map> | |
#include <string> | |
using namespace std; | |
template<class K, class V> | |
class cache | |
{ | |
private: |
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
# https://matklad.github.io/2020/04/13/simple-but-powerful-pratt-parsing.html | |
# it's amazing that rust version is actually shorter, wow | |
from collections import namedtuple | |
from enum import Enum | |
from io import StringIO | |
class PrattErr(RuntimeError): | |
def __init__(self, msg): | |
super().__init__(self, msg) |
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
// convert a date to timestamp as if it is a UTC date | |
// in other words used to remove local timezone info and fake everything as UTC | |
// must beware the funky api naming | |
// workaround js UTC date things | |
// the general rule is treat date as naive datetime with no timezone info | |
// using UTC timezone is better since it won't change based on user's computer location | |
function asUTCTimestamp(date) { | |
return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), | |
date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()); |
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
// | |
// The following include files must come first. | |
#ifndef COOL_TREE_HANDCODE_H | |
#define COOL_TREE_HANDCODE_H | |
#include <iostream> | |
#include "tree.h" | |
#include "cool.h" | |
#include "stringtab.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 System; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.Editing; | |
// ref https://msdn.microsoft.com/en-us/magazine/mt707527.aspx | |
// needed packages | |
// Microsoft.CSharp; | |
// Microsoft.CodeAnalysis; | |
// Microsoft.CodeAnalysis.CSharp; | |
// Microsoft.CodeAnalysis.CSharp.Workspaces; |
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
================================================================= | |
==6756==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x11b647ca0820 in thread T0: | |
object passed to delete has wrong type: | |
size of the allocated type: 24 bytes; | |
size of the deallocated type: 8 bytes. | |
#0 0x7ff6990d82aa in operator delete(void *, unsigned __int64) D:\agent\_work\13\s\src\vctools\crt\asan\llvm\compiler-rt\lib\asan\asan_new_delete.cpp:172 | |
#1 0x7ff6990dd4a0 in ply::OutPipe::`scalar deleting dtor'(unsigned int) C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xthreads.h:129 | |
#2 0x7ff6990d9404 in ply::OutStream::destructInternal(void) C:\Dev\plywood\repos\plywood\src\runtime\ply-runtime\io\OutStream.cpp:50 | |
#3 0x7ff6990914dd in ply::OutStream::~OutStream(void) C:\Dev\plywood\repos\plywood\src\runtime\ply-runtime\io\OutStream.h:118 | |
#4 0x7ff6990912da in main C:\Dev\plywood\repos\plylox\PipeLeak\Main.cpp:8 |
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
*.meta |
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 UnityEditor; | |
using UnityEditor.MemoryProfiler; | |
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
// Standalone menu item to dump memory to a text format that's | |
// more easier to diff on. | |
namespace MemoryProfilerWindow |
NewerOlder