Set noise interval with script?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Lukas
Posts: 1336
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Set noise interval with script?

Post by Lukas »

Hey guys,

Does anyone know how I can set the noise interval of a layer with lua?

I need to apply the sketchy effect with a script, but needed my own values:

Code: Select all

		vectorLayer.fNoisyLines = true;
		vectorLayer.fNoisyShapes = true;
		vectorLayer.fAnimatedNoise = true;
		vectorLayer.fExtraSketchy = false;
		vectorLayer.fExtraLines = 0;
		vectorLayer.fNoiseAmp = 50.0 / moho.document:Height();
		vectorLayer.fNoiseScale = 111.0 / moho.document:Height();
		vectorLayer.fNoiseInterval = 2
I tried adding "fNoiseInterval" but it doesn't work, and I can't find any info on lua for asp anywhere. Where should I look for these things?

The rest of the script works fine.

PS- I have no knowledge of .lua... :|
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Re: Set noise interval with script?

Post by heyvern »

When you say the rest of the script works fine, it's only the interval that isn't set?

I think maybe that specific value is not available in the scripting interface. Just a guess. I did a search of the script interface and couldn't find any reference to that particular property.

I can't remember specifically but I think the noise interval might be a new addition to the sketchy feature. It might not be in the scripting interface yet.

you can look here for lua scripting reference with ASP:

http://animestudioscripting.com/moho
User avatar
hayasidist
Posts: 3849
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Set noise interval with script?

Post by hayasidist »

are you looking for "interval" in noisy interpolation?? (i.e. 1 to interpolate every frame, 2 to animate on 2's, 3 to animate on 3's, etc.). if so it's in the interpSettings control block (9.5 only) .. check pkg_moho.lua_pkg
User avatar
Lukas
Posts: 1336
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Set noise interval with script?

Post by Lukas »

Thanks guys :)
amanandink
Posts: 259
Joined: Wed Feb 13, 2008 10:28 pm
Location: Kilkenny, Ireland
Contact:

Re: Set noise interval with script?

Post by amanandink »

Hey Lukas

did you figure out about the interval settings? if it is possible to have an interval of 2

thanks
Jeremy
User avatar
Lukas
Posts: 1336
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Set noise interval with script?

Post by Lukas »

amanandink wrote:Hey Lukas

did you figure out about the interval settings? if it is possible to have an interval of 2

thanks
Jeremy
I haven't been able to put it in the script yet...

But it's possible to have a noise interval of 2:
Image

Setting the entire animation of a layer on 2s isn't possible unless you keyframe it that way. It would be a nice function to have though... I think I made an issue about it on mantis a while ago.
amanandink
Posts: 259
Joined: Wed Feb 13, 2008 10:28 pm
Location: Kilkenny, Ireland
Contact:

Re: Set noise interval with script?

Post by amanandink »

thanks Lukas

no problem, its a little annoying to have to do it outside the apply sketchy script but I can do a find and replace in the code and change all layers to an interval of 2.

thanks again
J
User avatar
Lukas
Posts: 1336
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Set noise interval with script?

Post by Lukas »

amanandink wrote:thanks Lukas

no problem, its a little annoying to have to do it outside the apply sketchy script but I can do a find and replace in the code and change all layers to an interval of 2.

thanks again
J
Ah, good to know it's possible to do it that way.

If I can get it in the script I'll share it here.
Post Reply