Align objects on same layer, too.
Moderators: Víctor Paredes, Belgarath, slowtiger
- synthsin75
- Posts: 10051
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Align objects on same layer, too.
I followed your steps in v14.1, using the second version of my script, and it works as expected. At least in destructive mode, like you're using it.
My guess is that something is being done too fast after creating the new layer. The second version merges to the last selected layer, so no new layer is created.
EDIT: ^That's not the problem. The first version of my script doesn't select the curves for you, so if nothing's selected, it doesn't copy anything. I think I'll remove that version.
My guess is that something is being done too fast after creating the new layer. The second version merges to the last selected layer, so no new layer is created.
EDIT: ^That's not the problem. The first version of my script doesn't select the curves for you, so if nothing's selected, it doesn't copy anything. I think I'll remove that version.
- 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/
Re: Align objects on same layer, too.
Thanks, Wes! I confess I lost track of which version I have installed right now. Let me try again, making sure I have the second version installed. BRB.
Last edited by Greenlaw on Wed Dec 27, 2023 10:29 pm, edited 1 time in total.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Re: Align objects on same layer, too.
it worked for me theres to things different of mine in the merge script i changed the destructive to false and after using the break apart i took all the layers out of the group the script made then did the same as in the video
Re: Align objects on same layer, too.
That did it! I replaced the Merge Vector script with 1.1 (I must've regressed to 1.0 last night for some reason.) I didn't have to extract layers from the group, it just worked this time. Tested in Moho 13.5, not 14.1.
Testing in 14.1 now.
Testing in 14.1 now.
Last edited by Greenlaw on Wed Dec 27, 2023 9:48 pm, edited 1 time in total.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
- synthsin75
- Posts: 10051
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Align objects on same layer, too.
If the workflow works, I assume AEseeva's Reset Layer Transform could be made to work over a table of the layers produced by Break Apart and combined with the relevant parts of RT:Break Apart and Merge Vectors. I have too much on my scripting plate at ATM, or I'd volunteer.
- 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/
Re: Align objects on same layer, too.
Yay! After replacing the Merge Vector script with 1.1, the workflow is fine in Moho 14.1 too. No need to modify the script or move layers from the group...it just works now!
Here's a video of the process in Moho 14.1 with the successful result...
Test: Align Shapes Workflow, Success!
Thanks everyone for helping me figure this out. That was fun and I'm glad we solved it. I'm not sure how often I'd use this technique, but I know it will come in handy sooner or later.
I think I'll make a macro for this sequence later today. It's mainly the repetitive Reset Layer Transform part that needs automation. Quick question: I'm pretty sure I've asked this before, and I think the answer is no, but is there a way to assign a hotkey to a menu script from within Moho? I guess I can turn the script into a button, which would be a little better than selecting from the nested menu. Just a thought.
Here's a video of the process in Moho 14.1 with the successful result...
Test: Align Shapes Workflow, Success!
Thanks everyone for helping me figure this out. That was fun and I'm glad we solved it. I'm not sure how often I'd use this technique, but I know it will come in handy sooner or later.
I think I'll make a macro for this sequence later today. It's mainly the repetitive Reset Layer Transform part that needs automation. Quick question: I'm pretty sure I've asked this before, and I think the answer is no, but is there a way to assign a hotkey to a menu script from within Moho? I guess I can turn the script into a button, which would be a little better than selecting from the nested menu. Just a thought.
Last edited by Greenlaw on Wed Dec 27, 2023 9:45 pm, edited 5 times in total.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Re: Align objects on same layer, too.
I thought I might take a stab at that myself. It should be a good learning exercise for me. Sigh! I'm kinda busy with stuff today (not Moho-related,) but maybe later this week.synthsin75 wrote: ↑Wed Dec 27, 2023 9:16 pm If the workflow works, I assume AEseeva's Reset Layer Transform could be made to work over a table of the layers produced by Break Apart and combined with the relevant parts of RT:Break Apart and Merge Vectors. I have too much on my scripting plate at ATM, or I'd volunteer.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
- synthsin75
- Posts: 10051
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Align objects on same layer, too.
Making AEseeva's Reset Layer Transform work for all selected layers would be the simplest, and address the most tedious part.Greenlaw wrote: ↑Wed Dec 27, 2023 9:39 pmI thought I might take a stab at that myself. It should be a good learning exercise for me. Sigh! I'm kinda busy with stuff today (not Moho-related,) but maybe later this week.synthsin75 wrote: ↑Wed Dec 27, 2023 9:16 pm If the workflow works, I assume AEseeva's Reset Layer Transform could be made to work over a table of the layers produced by Break Apart and combined with the relevant parts of RT:Break Apart and Merge Vectors. I have too much on my scripting plate at ATM, or I'd volunteer.
Yeah, sadly, it'd have to be a button to get a shortcut.
- 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/
- synthsin75
- Posts: 10051
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Align objects on same layer, too.
My merge vectors script has what you need to find the selected layers in the document:
Code: Select all
local layers = {}
local count = 0
repeat
local layer = moho.document:LayerByAbsoluteID(count)
if layer then
count = count + 1
if (layer:SecondarySelection() and layer:LayerType() == MOHO.LT_VECTOR) then
table.insert(layers, moho:LayerAsVector(layer)) --either make a table to loop through, as shown here and used below, or just do what you need here
end
end
until not layer
Code: Select all
-- if looping through the table made above
for i,v in ipairs(layers) do
if (v:LayerType() == MOHO.LT_VECTOR) then
--do stuff here
end
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/
Re: Align objects on same layer, too.
Here is a version of the AE Reset Layer script that I modded a while ago, which acts recursively. Also with icon for use as a Button. Someone also wanted this on discord about a week ago. https://drive.google.com/file/d/1VUrCPa ... sp=sharing
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Re: Align objects on same layer, too.
Thanks guys! I really appreciate the tips and the modded Aeseeva script!
Can't wait to pick these apart and maybe Frankenstein a new script myself. Since I'm starting to use Moho more regularly again, one of my goals this year is to get more comfortable with Moho scripting.
Can't wait to pick these apart and maybe Frankenstein a new script myself. Since I'm starting to use Moho more regularly again, one of my goals this year is to get more comfortable with Moho scripting.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Re: Align objects on same layer, too.
Ha ha! Yeah...I've been off all last week, and I still haven't found time for personal projects because of family time. I have one week left in my vacation though, so maybe there's still time.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Re: Align objects on same layer, too.
So the time difference with the US from Europe is a week? Wow, lucky you!
Best wishes for 2024! May all your wishes come true and you got time to do the scripting thing!
Adults should play more often