pattern along path - using image for pattern

Post questions on how to use or achieve an effect in Inkscape.
User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

pattern along path - using image for pattern

Postby Grobe » Thu Jul 21, 2011 2:23 am

Hi.

Is it possible to use an image (imported png, jpg, etc) and using that image with the pattern along path extension?

I have tried to do that, but I just get an error when I try:
Please first convert objects to paths! (Got [{http://www.w3.org/2000/svg}image].)
Traceback (most recent call last):
File "pathalongpath.py", line 284, in <module>
e.affect()
File "D:\Cad\inkscape\share\extensions\inkex.py", line 227, in affect
self.effect()
File "pathalongpath.py", line 203, in effect
self.prepareSelectionList()
File "pathalongpath.py", line 144, in prepareSelectionList
self.objectsToPaths(self.skeletons)
File "D:\Cad\inkscape\share\extensions\pathmodifier.py", line 237, in objectsToPaths
aList[newnode.get('id')]=newnode
AttributeError: 'NoneType' object has no attribute 'get'


Then I try to convert the image file into pattern.

Now, when I try the same, Inkscape do something completely weird that make nonsense to me. Instead of putting the image (now converted to pattern) on the path, it draw a very weird new path onto and beside the image location.

In the above description, I've make sure that the path is the topmost object. If I repeat the above step, but making the path the bottom object, the results also getting very weird.

Is this a known bug, or is it me doing something wrong?
Attachments
pattern_before.svg
Before "pattern along path" is applied
(4.15 KiB) Downloaded 180 times
pattern_after.svg
(66.99 KiB) Downloaded 178 times
:lol:

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: pattern along path - using image for pattern

Postby druban » Thu Jul 21, 2011 2:55 am

You want the scatter extension, not pattern along path, for bitmaps.
Your mind is what you think it is.

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: pattern along path - using image for pattern

Postby Grobe » Thu Jul 21, 2011 4:00 am

Again - Thanks a lot druban :D

I'd just settled down and beleived it was just another stupid bug. And it wasn't :)
Only bug here is myself :shock:

However I really cannot manage to find any tutorials online where the Scatter extension is covered. I have this option I wonder what to choose.

Code: Select all

Original pattern will be: Moved/Copied/Cloned


I know that I'll get the same visible result regardless of what of the three choices I make.
The choice Clone is pretty obvious because I can alter the original object to alter all. Is there any reasons why I should prefer eg. Moved instead of Copied? (can't see the difference exept that original object deletes if I select Moved)


[edit]
It's hard to use smilys to show how happy I am. What to do then? Well - adding MORE smilies of course.
HappyIAM.png
Just a bunch of smilies
HappyIAM.png (134.43 KiB) Viewed 3028 times


However, while I had some fun with the smilies, a new question arised. In the Scatter dialog box, there is an option

Code: Select all

If pattern is a group, pick group members: Randomly/Sequentially


I would like to know it I can use this somehow to get random smilies onto same path.
Attachments
HappyIAM.svg
(42.82 KiB) Downloaded 171 times
:lol:

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: pattern along path - using image for pattern

Postby ~suv » Thu Jul 21, 2011 5:45 am

Grobe wrote:However, while I had some fun with the smilies, a new question arised. In the Scatter dialog box, there is an option

Code: Select all

If pattern is a group, pick group members: Randomly/Sequentially

I would like to know it I can use this somehow to get random smilies onto same path.

You can find more information about the new feature of the 'Scatter' extension here:
Bug #617045 in Inkscape: “Enhancement to the Scatter Extension

Please do not forget that you decided to work with unstable development builds - they do include new features which are not yet documented and might still change before the next stable release.

BlackEyedFish
Posts: 3
Joined: Fri May 11, 2012 10:06 pm

Re: pattern along path - using image for pattern

Postby BlackEyedFish » Fri May 11, 2012 10:16 pm

I can't get this to work at all, after about an hour of searching I can't find anyone explaining it.

I have a simple path and an image I want to repeat along it.

I make sure the image is on top, select both and click: Extensions > Generate from Path > Scatter...

No matter what options I choose I get the error:

Traceback (most recent call last):
File "pathscatter.py", line 275, in <module>
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 215, in affect
self.effect()
File "pathscatter.py", line 218, in effect
mat=[[1,0,-(bbox[0]+bbox[1])/2],[0,1,-(bbox[2]+bbox[3])/2]]
TypeError: 'NoneType' object is unsubscriptable


What am I doing wrong?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: pattern along path - using image for pattern

Postby brynn » Sat May 12, 2012 4:15 am

Welcome BlackEyedFish :D

I appreciate that you've done some searching, and have tried to find a solution to your problem before posting your questions. But I'm totally confused about what you're trying to do :?

I might guess that you've posted your message here (in an existing topic) instead of starting a new topic, because you're trying to do one of the few different techniques that are discussed previously in this topic. Is that correct? If so, would you tell us which one? or otherwise, would you please describe what you're trying to do with a little more detail? Pattern Along Path extension and Scatter extension do fairly different things, although clearly there is some overlap. But since I don't know exactly what you're trying to do, I have no idea if one would be better than the other. From your description: "I have a simple path and an image I want to repeat along it." it's even possible that you would need to use the Spray tool. If it's hard to describe, maybe you could find a screenshot of something similar? Or if you're following a tutorial, could you give us a link to it?

Is the image an imported PNG, or is it SVG or maybe even some other format? If it's an SVG, what kind of objects are involved (circles, paths, text, etc......??)

BlackEyedFish
Posts: 3
Joined: Fri May 11, 2012 10:06 pm

Re: pattern along path - using image for pattern

Postby BlackEyedFish » Sat May 12, 2012 8:09 pm

Thanks for your quick reply.
I'm not sure how to be more succinct.

The image with the smilies spelling out "happy I am" is pretty much the idea of what I want to do. I assume it was produced by cloning the image and have it follow along a path, using the scatter extension as was suggested above.

Preferably I would like to repeat a PNG with transparency, but I can convert to pretty much any format if necessary.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: pattern along path - using image for pattern

Postby brynn » Sun May 13, 2012 12:37 am

The image with the smilies spelling out "happy I am" is pretty much the idea of what I want to do.

Aaahh, ok, that gives me an idea what the situation is, so now I can look at that file, and hopefully learn enough to help you. I'll post again as soon I've looked at it :D

Edit
Oh ok! I had never used that extension before, but I like it MUCH better than pattern along path. Pap can be tricky, in my expeience.

Anyway, while with pap the object does not need to be converted to a pattern before applying the extension or LPE, apparently with this Scatter extension, it does. Try this: Select the PNG and do Object menu > Pattern > Object to Pattern. Now it should be repeated along your skeleton path beautifully!

By the way, without converting it to a pattern, I had an almost identical error message as you. So I'm pretty sure converting to pattern should do the trick :D

Edit
Correction -- if I draw a path to use as the pattern, I don't have to convert to pattern. But the PNG that I tested with did have to be converted.

BlackEyedFish
Posts: 3
Joined: Fri May 11, 2012 10:06 pm

Re: pattern along path - using image for pattern

Postby BlackEyedFish » Sun May 13, 2012 10:19 am

Perfect! Ta very much.


Return to “Help with using Inkscape”