In light of the Coronavirus crisis, please help make sure nothing stands in the way of social distancing in the VFX industry.

This petition asks the MPAA to act accordingly:


Sign the petition on Change.org

Be safe, everyone.

Script command to open console ?

User avatar
kiboost
Posts: 38
Joined: Wed Jan 08, 2020 1:38 am
Been thanked: 4 times

Script command to open console ?

#1

Post by kiboost » Fri Feb 07, 2020 10:55 am

Hi,

Is there a way to open the console windows ?
Can be usefull for outputing large commands result, debugs and such. Sure we can build another QWindow with a textaera but simply opening console window could be helpfull sometime.

User avatar
SecondMan
Site Admin
Posts: 4247
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 16
Location: Vancouver, Canada
Been thanked: 63 times
Contact:

Re: Script command to open console ?

#2

Post by SecondMan » Fri Feb 07, 2020 11:10 am

This works to bring the Console View to the foreground in Fu9:

Code: Select all

comp:GetFrameList()[1]:SwitchMainView('ConsoleView')
No idea how to launch the Console in Fu16, though... but it would be good to know :)

User avatar
kiboost
Posts: 38
Joined: Wed Jan 08, 2020 1:38 am
Been thanked: 4 times

Re: Script command to open console ?

#3

Post by kiboost » Fri Feb 07, 2020 11:12 am

Ahah !
Thanks, will start from there and see if I can get it to work in 16!

User avatar
Movalex
Sir Requestalot
Posts: 200
Joined: Fri Nov 03, 2017 5:36 am
Answers: 2
Been thanked: 20 times
Contact:

Re: Script command to open console ?

#4

Post by Movalex » Fri Feb 07, 2020 12:04 pm

SecondMan wrote:
Fri Feb 07, 2020 11:10 am
No idea how to launch the Console in Fu16, though... but it would be good to know :)
comp:DoAction("Console_Show", {show = true})
comp:DoAction("Console_Show", {show = false})

or just comp:DoAction("Console_Show", {}) to toggle.

User avatar
SecondMan
Site Admin
Posts: 4247
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 16
Location: Vancouver, Canada
Been thanked: 63 times
Contact:

Re: Script command to open console ?

#5

Post by SecondMan » Fri Feb 07, 2020 12:31 pm

Ooooh! Thanks @Movalex ! :)

User avatar
kiboost
Posts: 38
Joined: Wed Jan 08, 2020 1:38 am
Been thanked: 4 times

Re: Script command to open console ?

#6

Post by kiboost » Fri Feb 07, 2020 1:14 pm

Works perfect, thanks !!

For python users:

Code: Select all

comp.DoAction("Console_Show", {'show': True})
Any idea how to clear it ?

EDIT: didn't find a do_action for clear but I guess print('\n\n') is enough.

User avatar
kiboost
Posts: 38
Joined: Wed Jan 08, 2020 1:38 am
Been thanked: 4 times

Re: Script command to open console ?

#7

Post by kiboost » Thu Feb 13, 2020 4:51 am

Digging into fusion classes, finding lot of interesting stuff, and on this subject you can also use:

Code: Select all

if not fusion.IsConsoleShowing():
        fusion.ShowConsole()
ShowConsole() is a toggle, and IsConsoleShowing() return False or True

Or simply:

Code: Select all

fusion.ShowConsole(True)

;)