Skip to content

Instantly share code, notes, and snippets.

View ghiboz's full-sized avatar
🍺
Focusing

Paolo Ghibaudo ghiboz

🍺
Focusing
View GitHub Profile
@ghiboz
ghiboz / io_export_grally.py
Last active February 20, 2022 16:15
Export Spline Blender
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ghiboz
ghiboz / OpenWithSublimeText3.bat
Created September 21, 2016 11:08 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@ghiboz
ghiboz / ExportSpline.ms
Created April 9, 2015 14:09
ExportSpline
macroScript ExportSpline category:"ghiboz"
(
for o in selection do
(
nS = numSplines o
print ("num total splines:" +nS as string )
nK = numKnots o
print ("num total knots:" + nK as string )
@ghiboz
ghiboz / snippets
Last active August 29, 2015 14:13
Ogre 1.x to Ogre 2.x
// node iterator
// 1.x
Ogre::Node::ChildNodeIterator node_it = node->getChildIterator();
// 2.x
Ogre::Node::NodeVecIterator node_it = node->getChildIterator();
// create child
// 1.x
mEarNode = scene->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(0,0,0), Ogre::Quaternion::IDENTITY);
Ogre::SceneNode * nodeSign = node->createChildSceneNode(sName);
@ghiboz
ghiboz / ghibozTools.mcr
Last active August 29, 2015 14:08
ghiboz Tools v1
macroScript GhibozTools category:"ghiboz"
(
rollout GhibozTools "ghiboz tools"
(
group "Materials 255 :"
(
--spinner _SRad "radius" range:[0,30,10] scale:0.0001
--button _About "About Button"
button _Btn255 "Color Selected Objects"
toolTip:"Set ambient, diffuse and specular to 255 255 255"
@ghiboz
ghiboz / weldSmooth.mcr
Last active August 29, 2015 14:07
weld vertex and smooth the meshes
macroScript WeldSmooth category:"ghiboz"
(
for o in selection do
(
if( isKindOf o GeometryClass ) then -- weld only in geometry objects
(
if classof o.baseObject == Editable_Mesh then
(
print o.name
meshOp.weldVertsByThreshold o.mesh o.mesh.verts 0.001
@ghiboz
ghiboz / setMat.mcr
Last active August 29, 2015 14:07
set ambient, diffuse e spec a 255 255 255
macroScript TestMaterial category:"ghiboz"
(
materialID = 1
print '-------------------'
for materialID=1 to meditmaterials.count do
(
if (classof meditMaterials[materialID] == Standardmaterial) then
(
if (meditMaterials[materialID] != undefined) then
(
void Render::initShiny()
{
/// material factory setup
sh::OgrePlatform* platform = new sh::OgrePlatform("General", sBasePath + "data/common");
platform->setCacheFolder(PATHMANAGER::GetCacheDir());
mFactory = new sh::Factory(platform);
sh::Factory& fct = sh::Factory::getInstance();
fct.setReadSourceCache (true);
@ghiboz
ghiboz / grDs.mat
Created August 5, 2014 13:24
the grDS.mat is the main file
material grsDS
{
lod_values 0.1 2
diffuse 1 1 1 1
specular 0 0 0 0 1
ambient 1 1 1
emissive 0 0 0
scene_blend default
@ghiboz
ghiboz / 0_reuse_code.js
Created June 26, 2014 08:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console