*NEW* Stacked shape tools

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
alanthebox
Posts: 216
Joined: Sat Feb 03, 2018 8:31 am
Contact:

Re: *NEW* Stacked shape tools

Post by alanthebox »

So if I understand all this correctly, all the elements of this lamp exist on a single vector layer and the different shapes all share the same intersecting points, making any movement of those points apply more evenly to the combined shape?

I'm not sure why this is such a difficult concept for me to grasp! I often have overlapping shapes that I usually manipulate with the magnet tool (turning on the "selected points only" option when needed).

I appreciate the time everyone has taken to explain the application of this script!
User avatar
Greenlaw
Posts: 11031
Joined: Mon Jun 19, 2006 9:45 am
Location: Los Angeles
Contact:

Re: *NEW* Stacked shape tools

Post by Greenlaw »

Hi Wes,

I popped in here because I needed a refresher on how to use this tool, and I noticed the download link no longer works.

I have the script so no problem here but I thought you'd like to know.

D.
Animations, Tutorials, and Cats (Oh, My!) Little Green Dog Channel on YouTube!

D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | My DreamWorks Animation Reels & Others
User avatar
synthsin75
Posts: 10511
Joined: Mon Jan 14, 2008 2:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Stacked shape tools

Post by synthsin75 »

Thanks for the heads up. I've updated the link.
User avatar
Greenlaw
Posts: 11031
Joined: Mon Jun 19, 2006 9:45 am
Location: Los Angeles
Contact:

Re: *NEW* Stacked shape tools

Post by Greenlaw »

Hi Wes. Sorry, I should have checked this sooner but the link is currently reporting a 404 error.
Animations, Tutorials, and Cats (Oh, My!) Little Green Dog Channel on YouTube!

D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | My DreamWorks Animation Reels & Others
User avatar
synthsin75
Posts: 10511
Joined: Mon Jan 14, 2008 2:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Stacked shape tools

Post by synthsin75 »

Effin' Google drive changed my permissions. Should be good now. :?:
User avatar
Greenlaw
Posts: 11031
Joined: Mon Jun 19, 2006 9:45 am
Location: Los Angeles
Contact:

Re: *NEW* Stacked shape tools

Post by Greenlaw »

It's good!
Animations, Tutorials, and Cats (Oh, My!) Little Green Dog Channel on YouTube!

D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | My DreamWorks Animation Reels & Others
User avatar
sang820
Posts: 832
Joined: Thu Sep 09, 2004 10:55 pm
Location: china Beijing
Contact:

Re: *NEW* Stacked shape tools

Post by sang820 »

:shock: I'm reposting here from another post and I just want to say: this plugin is great! Thanks, synthsin75 =) Moho is better because of you. :shock:
User avatar
Greenlaw
Posts: 11031
Joined: Mon Jun 19, 2006 9:45 am
Location: Los Angeles
Contact:

Re: *NEW* Stacked shape tools

Post by Greenlaw »

Hi Wes,

I needed to use the Create Shape part of the Stacked Shape tools today in 14.1, and it still works great! Definitely saved me some time.

However, the Select Shape part seems to be broken. I'm seeing this error.

Image

Luckily, I only needed the Create Shape part, but I thought I should mention the problem with Select Shape.
Animations, Tutorials, and Cats (Oh, My!) Little Green Dog Channel on YouTube!

D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | My DreamWorks Animation Reels & Others
User avatar
synthsin75
Posts: 10511
Joined: Mon Jan 14, 2008 2:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Stacked shape tools

Post by synthsin75 »

Greenlaw wrote: Tue Apr 09, 2024 4:28 pm Hi Wes,

I needed to use the Create Shape part of the Stacked Shape tools today in 14.1, and it still works great! Definitely saved me some time.

However, the Select Shape part seems to be broken. I'm seeing this error.

Image

Luckily, I only needed the Create Shape part, but I thought I should mention the problem with Select Shape.
Here's an update for v14: https://drive.google.com/uc?export=down ... 1tSn9CoCUs
BigBoiiiJones
Posts: 97
Joined: Sun Mar 22, 2020 3:33 pm

Re: *NEW* Stacked shape tools

Post by BigBoiiiJones »

synthsin75 wrote: Tue Apr 09, 2024 5:38 pm
Greenlaw wrote: Tue Apr 09, 2024 4:28 pm Hi Wes,

I needed to use the Create Shape part of the Stacked Shape tools today in 14.1, and it still works great! Definitely saved me some time.

However, the Select Shape part seems to be broken. I'm seeing this error.

Image

Luckily, I only needed the Create Shape part, but I thought I should mention the problem with Select Shape.
Here's an update for v14: https://drive.google.com/uc?export=down ... 1tSn9CoCUs
Cant access
User avatar
synthsin75
Posts: 10511
Joined: Mon Jan 14, 2008 2:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Stacked shape tools

Post by synthsin75 »

Should work now.
User avatar
Greenlaw
Posts: 11031
Joined: Mon Jun 19, 2006 9:45 am
Location: Los Angeles
Contact:

Re: *NEW* Stacked shape tools

Post by Greenlaw »

synthsin75 wrote: Tue Apr 09, 2024 5:38 pm Here's an update for v14...
Thank you, Wes! It works perfectly now! :D
Animations, Tutorials, and Cats (Oh, My!) Little Green Dog Channel on YouTube!

D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | My DreamWorks Animation Reels & Others
User avatar
synthsin75
Posts: 10511
Joined: Mon Jan 14, 2008 2:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Stacked shape tools

Post by synthsin75 »

https://drive.google.com/uc?export=down ... 1tSn9CoCUs

I've updated the v14 create shape tool to prompt the user to check for new features in the stock tool when Moho is updated.
Hopefully this helps avoid confusion when updating.
User avatar
Greenlaw
Posts: 11031
Joined: Mon Jun 19, 2006 9:45 am
Location: Los Angeles
Contact:

Re: *NEW* Stacked shape tools

Post by Greenlaw »

Cool! Thanks, Wes.
Animations, Tutorials, and Cats (Oh, My!) Little Green Dog Channel on YouTube!

D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | My DreamWorks Animation Reels & Others
User avatar
synthsin75
Posts: 10511
Joined: Mon Jan 14, 2008 2:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Stacked shape tools

Post by synthsin75 »

One more update for the same thing. https://drive.google.com/uc?export=down ... 1tSn9CoCUs

For scripters:
This time I've figured out a more robust and universal way to mod stock tool replacements so they warn you when an update may have a new version of the tool.
This is one code block that can be pasted on the first line of the IsEnabled fucntion, completely as-is... no editing script names or anything. Just paste this right below:

function XX_ExampleTool:IsEnabled(moho)

Code: Select all

--syn\/
	if (not self.initializedVersion) then
		local name
		for n, value in pairs(_G) do
			if rawequal(value, self) then
				name = n
				break
			end
		end
		-- inject save pref remotely
		local origSavePrefs = self.SavePrefs
		self.SavePrefs = function(self, prefs)
			prefs:SetString(name..".MohoVer", self.MohoVer)
			if origSavePrefs then return origSavePrefs(self, prefs) end
		end
		-- load pref manually
		local path = moho:UserPrefsFile()
		local key = "\""..name..".MohoVer".."\""
		for line in io.lines(path) do
			if (string.find(line, key, 1, true)) then
				self.MohoVer = string.match(line, '"[^"]+"%s+"([^"]+)"')
				break
			end
		end
		self.initializedVersion = true
		self.foundName = name
		-- warn user of replacement tool when Moho updates
		if (self.MohoVer == nil) or (self.MohoVer ~= moho:AppVersion()) then
			local name = self.foundName
			
			local button = LM.GUI.Alert(LM.GUI.ALERT_WARNING, name.."\n This installed tool is a third-party replacement of the stock tool.\n If you have recently updated Moho, please check if this stock tool has\n been updated, and decide if you want to remove this replacement tool.", "(If you have installed this replacement for the first time, you can ignore this message.)","", "OK", "Remind me later")
			if (button == 0) then
				self.MohoVer = moho:AppVersion()
			end
		else
			self.initializedVersion = true
		end
	end
--syn/\
Post Reply