Changing all line widths

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
wizaerd
Posts: 415
Joined: Fri Aug 25, 2006 7:08 pm
Location: Gilbert, AZ

Changing all line widths

Post by wizaerd »

Anyone know of a way or a script that can change all line widths, even across layers?
myles
Posts: 821
Joined: Sat Aug 21, 2004 3:32 am
Location: Australia, Victoria, Morwell
Contact:

Post by myles »

Sorry, not me.

However, here's a potentially useful tip from Lost Marble:
To make the process easier in the future, you can set up a style before you draw anything. Create a new style, and name it "Line Qualities" (or whatever). Next, choose your new style as one of the Applied styles for new shapes. Now go ahead and draw all the lines you want (in any number of layers you want). All of these lines will have the new style applied to them. If you later want to change anything about the lines, just change the style, and all the lines will reflect the changes.
Amongst the things you can set up in the style is line width - somebody else posted about how they worked that way, but I couldn't find that post.

I've been using it myself lately - many shapes get a fill style and a "my outline" style.

Regards, Myles.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

The first thing I do when I start a new project is create a "default line" style.

I don't even set it to anything. I just create it... turn off the fill option... and name it default line.

Any shape I create from then on I always set it to the default line style.

You can sort of "automate" this by making that style already set in the style palette before creating new shapes. What ever is selected in the style palette before making a shape is used for any new shape.

this is really really helpful. I end up with tons of layers... bunches of shapes... and they all use the same default line style that I can change all at once. This is great for experimenting with styles. The stroke is also "independant" of the fill (you can use two styles for any shape. I use one for the fill and one for the stroke).

Of course you can use more than one "default line" style for different shapes.

-vern
wizaerd
Posts: 415
Joined: Fri Aug 25, 2006 7:08 pm
Location: Gilbert, AZ

Post by wizaerd »

I've recently started using styles more and more, but alas haven't used them 100%... I certainly see a reason and use for them, but hindsight is always 20/20...
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

You could try using a text editor and search and replace.

I have used this for other things, like changing multiple different style references from imported files to just one style... then I open the file in AS and delete all the unused styles... but I don't know exactly where the stroke info is in the file format.

It might be pretty simple though... once you find it.

-vern
wizaerd
Posts: 415
Joined: Fri Aug 25, 2006 7:08 pm
Location: Gilbert, AZ

Post by wizaerd »

I've edited my Style Names this very way, as well as Style Assignments, and it works well enough as well. I certainly wouldn't try to edit the style parameters this way, but it's easy enough building a new style in the app, then re-assigning it to every shape in the project via a text editor. Thanx vern...
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Okay...


This number in the shape info:
0.020833
represents "5" set in a moho stroke shape style.


This number:
0.041667
represents a "10" typed into the stroke width of a shape style.

... uh... hmm.... any clues how those numbers relate?

I mean... how is a "10" equal to "0.041667"?

I used a text editor and two identical files (just the stroke width changed) and did a comparison to find this one difference.

Figure that out... you could change the stroke globally.

At least I know where the stroke info is in the shape.

I suppose you could create a "temp" stroke... get that number and use a text editor to change all the others.

-vern
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Hah!

It is the pixel height of the project in the project settings.

0.020833 times 240 (the height in pixels) ends up pretty close to 5... the first number I used for the width.

Actually it was more like... 0.020833 x 239.99808001536 = 4.99988000096

When you change the pixel dimensions the thickness of the stroke will change to compensate.

Very interesting. I think a script could be written for this.

-vern
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

That doesn't surprise me a bit, Vern, because Moho (what AS was formerly known as) is a pixel-based vector program. Meaning that it uses pixels as its units, instead of inches or cms, as is usually the case in vector-based programs. It also means that when you change the dimensions of your project file, only those dimensions have to change in the file and not all occurrances of line widths in the entire project file.
Post Reply