Turn off scripts when rendering

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
JeroenKoffeman
Posts: 32
Joined: Tue Mar 24, 2015 3:04 pm

Turn off scripts when rendering

Post by JeroenKoffeman »

Dear Forum members,

Is it possible to check through script if anime is currently rendering?
Many of our scripts work in anime but not when rendering. So is it possible to detect if anime is rendering to automatically disable scripts when rendering?

Thanks in Advance,
Jeroen
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Turn off scripts when rendering

Post by synthsin75 »

No, but you could write a script that would remove all layerscripts in one step before you render. You could even have it store the list to add them back later.
JeroenKoffeman
Posts: 32
Joined: Tue Mar 24, 2015 3:04 pm

Re: Turn off scripts when rendering

Post by JeroenKoffeman »

Thanks for the quick reply.

Thanks for the approach but for now this method seems a bit cumbersome. I have found a bool: gridOn that will always be turned off when rendering. So I simply added:

if (moho.gridon == false) then return

on top of my script, and tell animators to work with grid enabled. However the grid snapping became a problem. Perhaps I can use another bool? Just something that will always return false in rendering.

Many THanks,

Jeroen
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Turn off scripts when rendering

Post by synthsin75 »

That's a good idea, and you know you can turn snapping off. But I wouldn't want to animate with the grid on myself. Let us know if you find something else that works.
JeroenKoffeman
Posts: 32
Joined: Tue Mar 24, 2015 3:04 pm

Re: Turn off scripts when rendering

Post by JeroenKoffeman »

Yes, the gridon unfortunately becomes to problematic.

I came with another idea; please confirm if you think I'm on the right track here.

The renderer does not render frame 0, can I invoke the script on frame zero so it will only work in anime studio itself?
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Turn off scripts when rendering

Post by synthsin75 »

If a layerscript only needs to work on frame zero then it doesn't need to be a layerscript...it could be a regular tool. Layerscripts are generally activated on each frame.

Have you tried View>Video safe zones?
JeroenKoffeman
Posts: 32
Joined: Tue Mar 24, 2015 3:04 pm

Re: Turn off scripts when rendering

Post by JeroenKoffeman »

Thanks for the reply. I ended up solving the problem by making some fixes in the script. Video safe zones could have do the trick as well, I guess.
Thanks
Post Reply