sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Closed Thread
 
Thread Tools
tuinbels's Avatar
tuinbels tuinbels is offline
Member
 
Join Date: Dec 2002
Location: Delft - Netherlands
Posts: 167
original message:
----------------------------------------------------------------------------------
[size=2]

Hi all,

I've made a script that extrudes selected faces along their normal.
something like this:


the script can be found here

Most of the time it works fine, but sometimes it gives error messages like this (in Blender228a):


Code:
Using a clean Global Dictionary. In Object_GetSelected() Traceback (most recent call last): File "extrudealongnormal.py", line 276, in bevent File "extrudealongnormal.py", line 205, in main AttributeError: 'NoneType' object has no attribute 'getSelectedFaces'
[/size]
[size=2]
I don't know where this NoneType comes from, because i select a mesh.
A file which gives this mistake is here

Anybody has a clue? :-?[/size]
-----------------------------------------------------------------------------

--edit--
script is here

script is updated, version 0.6.2, (26-01-04):
changes:
- script header added for blender232 compatibility
- specify the number of segments to extrude per face
- choose to make new mesh or use original mesh (with the possibility to UNDO the extrusion by entering editmode and pressing UKEY, if the mesh had already been edited before extrusion.

Greets,

Wim
#1   Old 22-Sep-03, 22:30   


theeth's Avatar
theeth theeth is offline
Administrator
 
Join Date: Oct 2001
Location: Montreal, Canada
Posts: 11,079
That will happen when there is no active object.

Martin
............................................
Life is what happens to you when you're busy making other plans.
- John Lennon
#2   Old 22-Sep-03, 22:34   
tuinbels's Avatar
tuinbels tuinbels is offline
Member
 
Join Date: Dec 2002
Location: Delft - Netherlands
Posts: 167
Hmm ... in the file I uploaded, there are only 2 objects, a camera and a mesh. i select the mesh (it turns pink) then enter faceselectmode (F), select some faces and execute the script. And it gives the same error.
#3   Old 22-Sep-03, 22:44   
MrNightmare MrNightmare is offline
Member
 
Join Date: Mar 2003
Location: North East U.S.A.
Posts: 366
I like this script. Wings can extrude this way...now I can do it in Blender also. Thanks.
............................................
Only those who have the patience to do simple things perfectly ever acquire the ability to do difficult things easily
#4   Old 22-Sep-03, 22:45   
theeth's Avatar
theeth theeth is offline
Administrator
 
Join Date: Oct 2001
Location: Montreal, Canada
Posts: 11,079
Got it. It happens when the name of the mesh datablock is different from the object datablock.

Instead of calling GetRaw, use ob.getData() to get the NMesh object.

Martin
............................................
Life is what happens to you when you're busy making other plans.
- John Lennon
#5   Old 22-Sep-03, 23:03   
Modron's Avatar
Modron Modron is offline
Member
 
Join Date: Aug 2003
Posts: 11,047
Here's a recent post regarding Shift S, which can almost do this.

http://www.elysiun.com/forum/viewtopic.php?t=15847
............................................
Here's a nodes tutorial on Using UV mapping to define material values: http://blenderartists.org/forum/showthread.php?t=73088
And here's another nodes tutorial on how to do a custom sequence wipe: http://blenderartists.org/forum/showthread.php?t=90989
#6   Old 23-Sep-03, 06:57   
tuinbels's Avatar
tuinbels tuinbels is offline
Member
 
Join Date: Dec 2002
Location: Delft - Netherlands
Posts: 167
Quote:
Originally Posted by theeth
Instead of calling GetRaw, use ob.getData() to get the NMesh object.
thanks for the help
updated version in first post
#7   Old 23-Sep-03, 10:57   
jms's Avatar
jms jms is offline
Member
 
Join Date: Mar 2002
Location: PACA, France
Posts: 3,475
Quote:
Originally Posted by Modron
Here's a recent post regarding Shift S, which can almost do this.

http://www.elysiun.com/forum/viewtopic.php?t=15847
In edit mode just after an "extrude",
alt-s makes a deplacement on normal
direction.

Notice also that there is yet an other script to do this
since years:
http://jmsoler.free.fr/didacticiel/b...ireshadows.htm
............................................
Ze French Group : ZOO-Blender | Starter Kit Blender (livre en français)
Daily updated Bpy API | Ze best french tutorials site.
#8   Old 23-Sep-03, 16:56   
theeth's Avatar
theeth theeth is offline
Administrator
 
Join Date: Oct 2001
Location: Montreal, Canada
Posts: 11,079
Quote:
Originally Posted by jms
Quote:
Originally Posted by Modron
Here's a recent post regarding Shift S, which can almost do this.

http://www.elysiun.com/forum/viewtopic.php?t=15847
In edit mode just after an "extrude",
alt-s makes a deplacement on normal
direction.

Notice also that there is yet an other script to do this
since years:
http://jmsoler.free.fr/didacticiel/b...ireshadows.htm
Yes, but Extrude will link the faces together whereas this script (and Wings too) extrude them individually.

Martin
............................................
Life is what happens to you when you're busy making other plans.
- John Lennon
#9   Old 23-Sep-03, 17:07   
Chimera Chimera is offline
Member
 
Join Date: Jul 2002
Location: Switzerland
Posts: 632
I love it! thx very much.
got b2.28, p2.23, linux and works just fine

cu

***EDIT***
a small... cheap... 2 minutes work of mine
http://files.blender3d.ch/temporary/extrude_normals.jpg
............................................
Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us!
Calvin (from Calvin&Hobbes), Strip Nr. 2\'840

in the works:
http://www.blender3d.ch/
#10   Old 23-Sep-03, 17:34   
jms's Avatar
jms jms is offline
Member
 
Join Date: Mar 2002
Location: PACA, France
Posts: 3,475
Quote:
Originally Posted by theeth
Yes, but Extrude will link the faces together whereas this script (and Wings too) extrude them individually.
Martin
I am just testing the script :
http://users.pandora.be/tuinbels/scr...alongnormal.py
and do not see how the faces are linked?

You can also use subsurf statement to see one little problem.
............................................
Ze French Group : ZOO-Blender | Starter Kit Blender (livre en français)
Daily updated Bpy API | Ze best french tutorials site.
#11   Old 23-Sep-03, 18:47   
tuinbels's Avatar
tuinbels tuinbels is offline
Member
 
Join Date: Dec 2002
Location: Delft - Netherlands
Posts: 167
Quote:
Originally Posted by jms
I am just testing the script :
http://users.pandora.be/tuinbels/scr...alongnormal.py
and do not see how the faces are linked?

You can also use subsurf statement to see one little problem.
I know the faces are not linked, thats why in the beginning of the script I said to remove doubles after executing the script
I don't have time right now, but i will try to change that.
............................................
Simplicate and add lightness
- Bill Stout, designer of the Ford Tri-Motor
#12   Old 23-Sep-03, 19:03   
ada89's Avatar
ada89 ada89 is offline
Member
 
Join Date: May 2003
Location: Malaysia
Posts: 525
Here is my test render:



Thanks tuinbels, for the script
............................................
Think
#13   Old 23-Sep-03, 19:17   
Chimera Chimera is offline
Member
 
Join Date: Jul 2002
Location: Switzerland
Posts: 632
here is my next one I just like this script

http://files.blender3d.ch/temporary/..._normals22.png
............................................
Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us!
Calvin (from Calvin&Hobbes), Strip Nr. 2\'840

in the works:
http://www.blender3d.ch/
#14   Old 23-Sep-03, 19:44   
ada89's Avatar
ada89 ada89 is offline
Member
 
Join Date: May 2003
Location: Malaysia
Posts: 525
Quote:
Originally Posted by Chimera
here is my next one I just like this script

http://files.blender3d.ch/temporary/..._normals22.png
Is it this:


and this?:


:P
............................................
Think
#15   Old 23-Sep-03, 20:43   
Chimera Chimera is offline
Member
 
Join Date: Jul 2002
Location: Switzerland
Posts: 632
I hate posting then as [img] ( I got a phpbb2 board at my own... I know the tags...) but visitors should choose if they want to see them. and belive it or not... there are still poor ones out there with a <128k connection .
............................................
Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us!
Calvin (from Calvin&Hobbes), Strip Nr. 2\'840

in the works:
http://www.blender3d.ch/
#16   Old 23-Sep-03, 20:47   
ada89's Avatar
ada89 ada89 is offline
Member
 
Join Date: May 2003
Location: Malaysia
Posts: 525
Quote:
Originally Posted by Chimera
I hate posting then as [img] ( I got a phpbb2 board at my own... I know the tags...) but visitors should choose if they want to see them. and belive it or not... there are still poor ones out there with a <128k connection .
no, not about that, its about u posted a wrong link :P
............................................
Think
#17   Old 25-Sep-03, 18:01   
Chimera Chimera is offline
Member
 
Join Date: Jul 2002
Location: Switzerland
Posts: 632
lol... SHAME ON ME! . everytime clicking on a dead link I though. "this ain't gonna happen to me "
............................................
Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us!
Calvin (from Calvin&Hobbes), Strip Nr. 2\'840

in the works:
http://www.blender3d.ch/
#18   Old 25-Sep-03, 19:16   
Jimmy Haze's Avatar
Jimmy Haze Jimmy Haze is offline
Member
 
Join Date: Aug 2003
Location: Amsterdam, the Netherlands
Posts: 117
This could be like the "matrix extrude" function in Cinema 4D xl6,

if you can set the number of segments to extrude,
set length of (segments) extrusions,
set x y z offset of (segments) extrusions,
set rotation of(segments) extrusions,
plus random parameters (size ,offset ,rot).
#19   Old 10-Oct-03, 18:19   
tuinbels's Avatar
tuinbels tuinbels is offline
Member
 
Join Date: Dec 2002
Location: Delft - Netherlands
Posts: 167
Quote:
Originally Posted by jms
I am just testing the script :
http://users.pandora.be/tuinbels/scr...alongnormal.py
and do not see how the faces are linked?

You can also use subsurf statement to see one little problem.
Fixed that (well, not completely, but trying to link all faces would be a bit more complicated)

updated script in first post

Quote:
Originally Posted by Jimmy Haze
This could be like the "matrix extrude" function in Cinema 4D xl6,
Sounds interesting, but that will have to wait some time, want de tentamens komen er weer aan

greets

Wim
............................................
Simplicate and add lightness
- Bill Stout, designer of the Ford Tri-Motor
#20   Old 11-Oct-03, 00:31   
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 11:50.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists