hi.
I want to test my layer script. but each time i have to create new layer and assign script. ctrl+shift+alt+L doesn't work. can any body give a better workflow?
write layer script workflow
Moderators: Víctor Paredes, Belgarath, slowtiger
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
write layer script workflow
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
- hayasidist
- Posts: 3566
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: write layer script workflow
I thought I had a script for this - but I can't find it right now -- but if you use MohoLayer:SetLayerScript(path) you can remove and reload the file ..
[edit]oh forget it:
Stan has one: https://mohoscripts.com/script/sz_refresh_layerscript
[edit]oh forget it:
Stan has one: https://mohoscripts.com/script/sz_refresh_layerscript
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
Re: write layer script workflow
thanks friends.
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
- synthsin75
- Posts: 10014
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: write layer script workflow
You can actually unembed, hit apply, and reembed, but the scripts make it much faster. My own just reloads all the layerscripts, probably like Stan's.davoodice2 wrote: ↑Sun Nov 07, 2021 11:22 am hi.
I want to test my layer script. but each time i have to create new layer and assign script. ctrl+shift+alt+L doesn't work. can any body give a better workflow?
Code: Select all
function Syn_ReloadLayerScripts:Run(moho)
local count = 0
repeat
local layer = moho.document:LayerByAbsoluteID(count)
if layer then
count = count + 1
local script = layer:LayerScript()
layer:SetLayerScript("")
layer:SetLayerScript(script)
end
until not layer
end
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
Re: write layer script workflow
thankssynthsin75 wrote: ↑Sun Nov 07, 2021 11:54 pmYou can actually unembed, hit apply, and reembed, but the scripts make it much faster. My own just reloads all the layerscripts, probably like Stan's.davoodice2 wrote: ↑Sun Nov 07, 2021 11:22 am hi.
I want to test my layer script. but each time i have to create new layer and assign script. ctrl+shift+alt+L doesn't work. can any body give a better workflow?Code: Select all
function Syn_ReloadLayerScripts:Run(moho) local count = 0 repeat local layer = moho.document:LayerByAbsoluteID(count) if layer then count = count + 1 local script = layer:LayerScript() layer:SetLayerScript("") layer:SetLayerScript(script) end until not layer end
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش