Inital copy from c3d/devtools/