Skip to content

Instantly share code, notes, and snippets.

@friesencr
friesencr / Example
Last active August 29, 2015 14:15
Urho3D Dumb IniParser
VariantMap ini;
File@ iniFile = cache.GetFile("o_o.ini");
if (ParseIni(iniFile, ini))
{
VariantMap main = ini["Main"].GetVariantMap();
log.Info(main["PlayerName"].GetString());
}
Methods for exporting a model from blender to Urho3d.
I have not tried using the native blender fbx export in the 2.71rc. Supposedly they have improved fbx exporting.
Method 1: blender-urho3d plugin
This method is the best and has the least amount off issues as of blender 2.70. The plugin bypasses the fbx/obj/collada exports which are buggy in blender. If you are working with multiple uv sets, this is the only sane way. The animations and skinning in the urho plugin are much more reliable/less buggy then the fbx export. The only feature it doesn't have is scenes.
Method 2: AssetImport
Urho3D ships with an asset conversion tool called AssetImport. AssetImport converts fbx/collada/obj to urho's native mdl format. It is a command line tool. I find the easiest way to use this tool is via the editor. Urho3D ships with an editor. There is a script to run the editor in the Bin location Editor.bat/Editor.sh respective to your operating system. In the file menu of the editor there is a scene import and a
@friesencr
friesencr / urho3d.prophpbb.com.js
Created January 28, 2014 04:41
urho forum hacks
lastPosts = $(".lastpost")
$.each(lastPosts, function(){
$a = $("a:first", this);
$a.text($a.attr("title"));
});
@friesencr
friesencr / reparent_multiple.diff
Created August 10, 2013 01:19
urho3d - holding down shift allows reparenting multple children
diff --git a/Bin/Data/Scripts/Editor/EditorActions.as b/Bin/Data/Scripts/Editor/EditorActions.as
index ed83000..440c28c 100644
--- a/Bin/Data/Scripts/Editor/EditorActions.as
+++ b/Bin/Data/Scripts/Editor/EditorActions.as
@@ -106,28 +106,75 @@ class ReparentNodeAction : EditAction
uint nodeID;
uint oldParentID;
uint newParentID;
+ Array<uint> nodeList; // 2 uints get inserted per node (node, node.parent)
+ bool multiple;
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
@friesencr
friesencr / gist:4743009
Created February 9, 2013 00:00
leadwerks character animation template
require("scripts/class")
require("scripts/math/math")
require("Scripts/constants/engine_const")
local class=CreateClass(...)
function class:CreateObject(model)
local object=self.super:CreateObject(model)
@friesencr
friesencr / lua_buffer_confusion
Created October 29, 2012 04:59
Confused about buffers why do they change
require("Scripts/constants/keycodes")
require("Scripts/constants/engine_const")
--Register abstract path
RegisterAbstractPath("")
--Set graphics mode
if Graphics(1024,768)==0 then
Notify("Failed to set graphics mode.",1)
return
require 'pathname'
puts Pathname.new(ARGV[0]).realpath.to_s
@friesencr
friesencr / decreaser
Created April 5, 2012 19:59
stich decreaser
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title</title>
<script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' charset="utf-8"> </script>
<script type="text/javascript" charset="utf-8">
function figureTheRows(row1,row2) {
if (row1 > 1 && row2 > 1) {
var ratio, counter, stitches, i, i_stitch, bigger;
bigger = row1 > row2 ? row1 : row2;
@friesencr
friesencr / gist:1174740
Created August 27, 2011 00:04
just in case
. .
. . IMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.IMMMMMMMMMMMMMM8I . ... . =MMMM
:MMMMMMMMMZ . 7MMMMZ . 7MD . IMMD .
MMMMM. . . . .~ .M, . MMM .
MMMM, N. .IDMMMO777ZNMMMMMO =MM . M:. NMM.
. ZMMM . . :7NMMDI= . MM IM MMM
MMM IMM77IDMMM, . M8 ..MM M ,N MMM
M8 M M . M ,O . 7. MM
.M8 D ,.