galagast
03-12-2005, 05:51 AM
is there a way to retrieve the name or title of a currently opened max scene? even if its untitled?..
coz the function cui.setApptitle doesnt have a counterpart...
Any way to get the current filename string will do.. ive been digging the docs and i cant seem to find an appropriate approach...
hmm.. is parsing the ini file [filelist] the only way to get the most current filename title string? coz this aint applicable if the user is working on an untitled scene...
here is the current code im working on... it updates the title much like how adobe after effects works whenever you're rendering...
macroscript Update_Frame_Title category:"Render" tooltip:"Update Frame Title"
(
local render_title_enabled = false
fn setrendertitle =
(
the_Start = (rendStart/160) as integer
the_End = (rendEnd/160) as integer
the_Frame = (currentTime/160) as integer
the_Total = (the_End - the_Start)+1
the_Time = (the_Frame - the_Start)+1
the_String = ("(" + the_Frame as string + "f) " + the_Time as string + " of " + the_Total as string)
cui.setAppTitle the_String
)
fn setrendertitleback =
(
the_Root = getdir #maxroot
the_Path = (the_Root + "3dsmax.ini")
the_Filepath = getinisetting the_Path "FileList" "File1"
the_Filename = filenameFromPath the_Filepath
the_Title = (the_Filename + " - 3ds max 6 - Stand-alone License")
cui.setAppTitle the_Title
)
on ischecked return render_title_enabled
on execute do
(
render_title_enabled = not render_title_enabled
if render_title_enabled then
(
callbacks.addscript #preRenderFrame "setrendertitle()" id:#render_title_info
callbacks.addscript #postRender "setrendertitleback()" id:#render_titleback_info
)
else
(
callbacks.removescripts #preRenderFrame id:#render_title_info
callbacks.removescripts #postRender id:#render_titleback_info
)
)
)
the only bug for now is if you're working with an unsaved max scene... it would return the most recent filename as the title after rendering.. which is quite wrong..
and as always... any help is much appreciated. :)
coz the function cui.setApptitle doesnt have a counterpart...
Any way to get the current filename string will do.. ive been digging the docs and i cant seem to find an appropriate approach...
hmm.. is parsing the ini file [filelist] the only way to get the most current filename title string? coz this aint applicable if the user is working on an untitled scene...
here is the current code im working on... it updates the title much like how adobe after effects works whenever you're rendering...
macroscript Update_Frame_Title category:"Render" tooltip:"Update Frame Title"
(
local render_title_enabled = false
fn setrendertitle =
(
the_Start = (rendStart/160) as integer
the_End = (rendEnd/160) as integer
the_Frame = (currentTime/160) as integer
the_Total = (the_End - the_Start)+1
the_Time = (the_Frame - the_Start)+1
the_String = ("(" + the_Frame as string + "f) " + the_Time as string + " of " + the_Total as string)
cui.setAppTitle the_String
)
fn setrendertitleback =
(
the_Root = getdir #maxroot
the_Path = (the_Root + "3dsmax.ini")
the_Filepath = getinisetting the_Path "FileList" "File1"
the_Filename = filenameFromPath the_Filepath
the_Title = (the_Filename + " - 3ds max 6 - Stand-alone License")
cui.setAppTitle the_Title
)
on ischecked return render_title_enabled
on execute do
(
render_title_enabled = not render_title_enabled
if render_title_enabled then
(
callbacks.addscript #preRenderFrame "setrendertitle()" id:#render_title_info
callbacks.addscript #postRender "setrendertitleback()" id:#render_titleback_info
)
else
(
callbacks.removescripts #preRenderFrame id:#render_title_info
callbacks.removescripts #postRender id:#render_titleback_info
)
)
)
the only bug for now is if you're working with an unsaved max scene... it would return the most recent filename as the title after rendering.. which is quite wrong..
and as always... any help is much appreciated. :)
