View Full Version : how would i change the default material?
moose o death
04-04-2008, 09:03 PM
hi.
i'm using xsi mainly or the creation of realtime stuff and i really have no use for the rendertree other than recomfiguring the default material back into something usable.
is there any way to change the default so everytime i generate an object it's attached to a material that has noicon as an image with ambience diffuse etc already attached. it's getting to be a nusiance to have to setup the exact same material every single time. i don't mind re assigning the texture but there's no need to remake the same material everytime.
ideally i wouldn't mind using the game engine's realtime shaders for that 100% accurate representation, is it possible to use opengl shaders in xsi?
Hello moose o death
I'm not sure but it seems pretty simple... can't you just create a material preset and use it every time??
Leo.
kim aldis
04-09-2008, 04:03 AM
you can change the default material. select the scene root and open the render tree or apply material. Every new object inherits this material but be aware that if you change the default every object that's inheriting it will reflect this change. If you don't want this behaviour then localise the material on your object. Get->Material->make local. If you wish you can assign this command to a hot key or button.
patrick.n
04-09-2008, 06:02 AM
I think moose wants to change it so grey phong is no longer the default material. So he doesn't have to change it each time a scene is started.
hmmm....
patrick.n
04-09-2008, 06:10 AM
KerryT posted a method that should do the trick:
http://www.xsibase.com/forum/index.php?board=9;action=display;threadid=33066
moose o death
04-09-2008, 08:52 AM
could do the trick, if i change the scene root, save that scene to the desktop and use it as my launch icon. it's not ideal but likely achieves my intention.
edit: yeah that works...well not perfectly, but does the trick, still have to apply an initial projection to a new model which i keep forgetting, but at least i wont need to make the same material every time. thanks for the help everyone
patrick.n
04-09-2008, 09:09 AM
I was meaning the final solution. so, if you want the default to be a lambert for example:
goto plugin manager, then file, then new, then Event.
then type in a plugin name, eg changeSceneMat, use the same for the next name.
Change the coding tab to JScript.
Change to the tab to event definition, the check "siOnEndNewSceneEvent",
scroll down to the bottom and click "generate code"
Lastly, look in your script editor, and where it says
' TODO: Put your code here.
put beneath that on a line on its own ..................drum roll......................
SelectObj("Sources.Materials.DefaultLib.Scene_Material", null, null);
CopyPaste(null, "Shaders\\Material\\Lambert.Preset", "TransientObjectContainer", null);
SIConnectShaderToCnxPoint("TransientObjectContainer.Lambert","Sources.Materials.DefaultLib.Scene_Material.surfac e",false);
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.Lamber t","Sources.Materials.DefaultLib.Scene_Material.shadow",false);
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.Lamber t","Sources.Materials.DefaultLib.Scene_Material.Photon",false);
Then save (in script editor)
So whenever you make a new scene, it will run that script.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.