Script access to image textures of shapes/styles

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
GaryC
Posts: 53
Joined: Tue Feb 03, 2015 1:02 pm

Script access to image textures of shapes/styles

Post by GaryC »

I've been trying to set up a script that can swap out the textures of the shapes inside a file as well as the styles. However I'm having trouble finding what field or function can return/edit these values.

I've looked through the documentation for mesh shape and style objects but not turned up anything relevant. Most of the values I can see are just looking for colour values instead of accepting paths to a texture. I saw some references to the effects field, but nothing that would return the information related to the effects in a way that could be processed and edited for my needs.

Does anyone know how to go about this, or what I might be missing?
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Script access to image textures of shapes/styles

Post by synthsin75 »

I don't think I've ever used these myself, but here's a start:

http://mohoscripting.com/index.php?show ... ct=texture
GaryC
Posts: 53
Joined: Tue Feb 03, 2015 1:02 pm

Re: Script access to image textures of shapes/styles

Post by GaryC »

Yeah, I was trying to use those but am just getting blank strings.
I've used it both on layers where the shapes have styles applied and ones with shapes that just had the textures applied to that shape specifically.

I also tried the fBrushName value on the associated Style objects just in case, but I just got nil results for the fBrushName value.
Post Reply