PDA

View Full Version : SceneExplorer Manager not working


JHN
12-20-2007, 07:38 PM
Hi,

I tried to make some custom functions for the scene explorer, but although they show up in the columnlist, the set function doesn't work... :sad:


--// Get function
fn getFov theNode = (
if isProperty theNode "Fov" then theNode.Fov )

--// Set function
fn setFov theNode theValue = (
if isProperty theNode "Fov" then theNode.Fov = theValue )

--// Assign to SceneExplorer
SceneExplorerManager.addProperty "Fov" getFov setFov



I even tried the examples in the mxs manual... and they didn't work either. It doesn't update the object radius or in my case the camera fov... I can type in something but no link to the scene. I tried the default light intensity setting column, and funny thing is that spinner appear there, but not on my values.. I have the feeling it has something to do with that, but the manual is not very clear on this. I really hope I'm missing something obvious.. otherwise this functionality is not well implemented in the scene-explorer and thus making this thing once again less usefull..... .. .

-Johan

ZeBoxx2
02-15-2008, 06:48 AM
Sorry for the late reply here - just did a quick google search for sceneExplorerManager to see if people have been coming up with cute tricks; alas :)

You probably have the answer already, but as it's not here in this thread...
( Edit: which, indeed, you do; http://forums.cgsociety.org/showthread.php?t=583907 )

Your set function doesn't work because the value fed to your function is class String, and string values don't auto-cast to Float.


fn setFov theNode theValue = (
if isProperty theNode "Fov" then theNode.Fov = theValue as float )

should do the trick. Keep in mind, however, that users may enter -any- value, included non-numbers; so you'll want to check that the value really was able to conver to a float:

fn setFov theNode theValue = (
if isProperty theNode "Fov" then theNode.Fov =
if ((theValue = theValue as float) != undefined)
then ( theValue )
else ( theNode.fov )
)

..though with that, people could still enter "5s" which readily converts to float as well, as it simply looks like a Time value to MaxScript, with the default FPS setting (30FPS) it will cast to a value of 150 (frames).

The MaxScript help sadly uses an example where an integer value is entered, and a string integer value -does- auto-cast to integer. hurrr.

There's probably going to be a lot of advancements in the Scene Explorer for 3ds Max 2009. I'm hoping automatically creating checkboxes/colorpickers in the UI when the return value is a boolean/color value is one of them ;)

JHN
02-15-2008, 07:17 AM
There's probably going to be a lot of advancements in the Scene Explorer for 3ds Max 2009. I'm hoping automatically creating checkboxes/colorpickers in the UI when the return value is a boolean/color value is one of them ;)

I really hope there is much more enhancement... cause with some simple scripts you could make an camera manager, light manager, whatever manager, without the need building a complete dynamic UI... It can be great, but now it really really sucks... and to be honest I'm not holding my breath on the further maxscript exposure of this tool. I think they tweak some UI and speed stuff and be done with it. But we'll wait and see.

-Johan

ZeBoxx2
02-15-2008, 09:33 AM
I'm keeping my fingers crossed, more than that I'm holding my breath; but we'll see :)

CGTalk Moderation
02-15-2008, 09:33 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.