a word of caution befor using these: As yet they only Apply The properties they are written for and DO NOT TOGGLE them so once you use them the resulting change is sort of perminite. once i have more time ill update them to Toggle the flags on and off but eh. not bad for a first look i dont guess.
these all add entrys into the tools menu list that applies the atributes under the appropriate name
ok to turn EMT_LIGHTING ON for the selecet mesh:
autostartLighting.nut
Code: Select all
function SetNodePropertyLighting()
{
local s = editorGetSelectedSceneNode();
local t = irrSetSceneNodeMaterialProperty(s, 0, "Lighting", "true");
if (s)
print(" Lighting Allplied");
else
print(" Lighting Failed");
editorUpdateAllWindows();
}
editorRegisterMenuEntry("SetNodePropertyLighting", "Apply Lighting");
autostartGuarardShading.nut
Code: Select all
function SetNodePropertyGouraudShading()
{
local s = editorGetSelectedSceneNode();
local t = irrSetSceneNodeMaterialProperty(s, 0, "GouraudShading", "true");
if (s)
print(" GouraudShading Enabled ");
else
print(" Property Not Applied ");
editorUpdateAllWindows();
}
editorRegisterMenuEntry("SetNodePropertyGouraudShading", "GouraudShading");
autostartnormals.nut
Code: Select all
function SetNodePropertyNormals()
{
local s = editorGetSelectedSceneNode();
local t = irrSetSceneNodeMaterialProperty(s, 0, "NormalizeNormals", "true");
if (s)
print("Normals Normalized");
else
print("Nothing Changed");
editorUpdateAllWindows();
}
editorRegisterMenuEntry("SetNodePropertyNormals", "Normalize");
aurostartZbuffer.nut
Code: Select all
function SetNodePropertyZBuffer()
{
local s = editorGetSelectedSceneNode();
local t = irrSetSceneNodeMaterialProperty(s, 0, "ZBuffer", "true");
if (s)
print(" ZBuffer Enabled ");
else
print(" Property Not Applied ");
editorUpdateAllWindows();
}
editorRegisterMenuEntry("SetNodePropertyZBuffer", "ZBuffer");
autostart trilinearfilter.nut
Code: Select all
function SetNodePropertyTrilinearFilter()
{
local s = editorGetSelectedSceneNode();
local t = irrSetSceneNodeMaterialProperty(s, 0, "TrilinearFilter", "true");
if (s)
print(" Trilinear Filter Enabled ");
else
print(" Properties Not Applied");
editorUpdateAllWindows();
}
editorRegisterMenuEntry("SetNodePropertyTrilinearFilter", "Trilinear Filter");
this one is a bit different , returns the scene node name in the output winow ( useful for GetSceneNodeFromName(); )
Code: Select all
function SelectedSceneNode()
{
local s = editorGetSelectedSceneNode();
if (s)
print("Node Name ' " + irrGetSceneNodeProperty(s, "Name") + " ' " );
else
print("Pick One First Dummy");
}
editorRegisterMenuEntry("SelectedSceneNode", "Node Name");
Code: Select all
function MaterialCount()
{
local s = editorGetSelectedSceneNode();
local a = irrGetSceneNodeMaterialCount(s);
print("the scene node has " + a + " materials");
}
editorRegisterMenuEntry("MaterialCount", "Material Count");
soon ill be prototyping and testing functions that add different meshes to the scene like say things like cars, trees, buildings ....and other static meshes , then all the level designer has to do is pop in the desired meshes and have the complete level lightmapped in one tool like Quake 3 GTKRadiant and halflifes Hammer editor and could be customized for each project and make level building with Irrlicht so much easyer : )
hope these end up being usful to some one even if as just a starting point for your own scripts