NEW interactive "inset extrude" addon!

there are problems with complex selection: returns error and doesn’t works. there are too many cases to understand where is the real bug.
except this, (i hope in bug fix) works fine. it’s a very good tool.
for next releases you can put the tool in the “Special” menu (W key) (it’s an idea :D)
bye

hey, for a coder to ‘think in advance’ of all the complex cases is a ridiculous burden to lay on him. Adding checks for more complex cases results in ugly unmaintanable code. In my book adding more than 1 island to inset and expecting certain results but getting different results is simply a fact of programming reality.

i think i may know the cause of this, it probably happens when the corners of two islands meet in one point, or at least i’m hoping you have stumbled upon that bug. sometimes it gives unexpected results and sometimes it makes the script fail completely. will do some more bugfixing as soon as i’ve got time, and as zeffi said there are lots of special cases to take into consideration, but with the help of you guys i’m hoping to get the algorithm as stable as possible.

EDIT:for example try selecting a checkerbord pattern and the script will fail

I think i have found another bug where certain selections cause skewed geo.
Hopefully this may help as it looks like a mix of the checker board error and something else :slight_smile:

Maybe have an option where you can use edges rather than using verts to calculate the selection would help?

http://img.photobucket.com/albums/v299/metalliandy/inset_extrude_1.gif

yeah that’s the bug i was talking about, i was aware of it when i first posted the script, and i have a pretty simple solution in mind that wont need any special user input

Basically I’m thinking of how the extrude function works now. Once I extrude I either scale towards the center to do an “inset” or outwards to grow outside of the bounds.

if a lot of people complain about the
interaction style i might consider reviewing it, but i urge you to test it for some
time before rejecting it as i personally feel it is very simple and fast as is.

No complaints, just making an observation. Awesome tool!

This Add-on is really fantastic!!

But I don’t get the shortcut to work. I did it exactly like you, also controlled twice the name I entered in User Preferences / Input / 3D-View / Mesh. It is “mesh.inset_extrude”. Nevertheless, pressing “I” does not react. I always must enter the values in the tool shelf, which is not very intuitive.

@ comeinandburn:
ok, understand what you’re thinking now. unfortunatly there are some aspects of this tool that makes such behavior impractical for the general case. i’ll keep it in mind though.

@blenderissimo:
you’ll have to give me some more info. what version of blender do you have, revision number? (you’ll need 2.57, and you can see the revision number in the splash screen) and what does the console say?
(show it by clicking help->toggle system console)

@JoS:
I am using version 2.57 with revision number r36147M on a new 13" Macbook Pro (i7 “sandy bridge”, intel hd 3000 graphics).

In system console I found this:
11.05.11 21:36:45 [0x0-0xc80c8].org.blenderfoundation.blender[1157] Cursor History draw-callback registration…
11.05.11 21:36:45 [0x0-0xc80c8].org.blenderfoundation.blender[1157] Cursor History draw-callback registered
11.05.11 21:36:45 [0x0-0xc80c8].org.blenderfoundation.blender[1157] Cursor Memory draw-callback registration…
11.05.11 21:36:45 [0x0-0xc80c8].org.blenderfoundation.blender[1157] Cursor Memory draw-callback registered
11.05.11 21:36:45 [0x0-0xc80c8].org.blenderfoundation.blender[1157] found bundled python: /Applications/Blender/blender.app/Contents/MacOS/2.57/python
11.05.11 21:36:45 [0x0-0xc80c8].org.blenderfoundation.blender[1157] search for unknown operator MESH_OT_inset_extrude, MESH_OT_inset_extrude
11.05.11 21:36:45 [0x0-0xc80c8].org.blenderfoundation.blender[1157] search for unknown operator MESH_OT_inset_extrude, MESH_OT_inset_extrude
11.05.11 21:36:45 [0x0-0xc80c8].org.blenderfoundation.blender[1157] Blender quit

Great addon, thank you!! I maped it to “I” key, I understand there is no other shortcut / button assigned by default yet. Worked well!
This tool it’s almost an “offset”, something that many miss from Blender. Maybe you could consider making a simple offset tool? Something that would work on edges, like drawing a poligon just edges and being able to extrude them the way you make the inset in this addon? Right now this can be achieved only on faces with the solidify modifier wich is great but a bit complicated in some instances, or by extruding, pressing esc and then scaling - only the scaling is not an uniform offset, not even with Alt-S. I hope I managed to explain this well.
Thanks, Oana

Hi JoS,

I have made exactly the same thinks that ktysdal to install your addon but Blender 2.57b don’t want to activate it.
Have you a road for me…

Blender 257b rev 36339

Traceback:
found bundled python: C:\PROGRA~1\BLENDE~1\Blender\2.57\python
addon_utils.disable Show_Hide_bytype not loaded
addon_utils.disable mesh_fake_knife not loaded
addon_utils.disable object_align_to_active_object not loaded
addon_utils.disable object_check_integrity not loaded
addon_utils.disable droptest not loaded
addon_utils.disable object_uv_helper not loaded
addon_utils.disable system_project_folder not loaded
addon_utils.disable mesh_bridge not loaded
addon_utils.disable add_mesh_beam_builder not loaded
addon_utils.disable add_mesh_polysphere_013 not loaded
addon_utils.disable mymesh not loaded
addon_utils.disable yafaray not loaded
addon_utils.disable luxrender not loaded
addon_utils.disable mesh_select_nonmanifold_edges not loaded
addon_utils.disable mesh_vertex_align_25 not loaded
addon_utils.disable add_mesh_archimedean_solids not loaded
addon_utils.disable mesh_uv_normalize not loaded
Reloading: <module ‘bl_operators’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_operators_init_.py’>
Reloading: <module ‘bl_ui’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_ui_init_.py’>
Reloading: <module ‘keyingsets_builtins’ from 'C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\keyingsets_builtins.py
'>
gc.collect() -> 13486.

I have make a “Install Addon” with the button and this is the resut:
http://dl.dropbox.com/u/28688718/Capture.00.JPG

@blenderissimo
it sounds as if you have not enabled the addon. you have to go in to add-ons and search for it, then enable it, and then i’d suggest you to save default user preferences.

@Spirou4D
did you use the copy function of pasteall, or did you mark all the text and copy it? does it show up in the list of add-ons? if you try to enable it but it fails what message does the console give? the current console message you pasted says nothing of this addon.

EDIT:
if you have placed your addon in the correct folder (2.57/scripts/addons) there is no need to install it. is that what you are doing?
try to enable it and see if it works

@Spirou4D
did you use the copy function of pasteall, or did you mark all the text and copy it? does it show up in the list of add-ons? if you try to enable it but it fails what message does the console give? the current console message you pasted says nothing of this addon.

I used the copy function of Pasteall.
Nothing in the list of addons:

Yes, i have try to Install Addon" button, i have this above message. I am intrigued, I have too used other Blender release and the same message: Blender do’nt install this addon! No explanation!

Thanks for your reply.

++: But no problem with the inset polygon of Haward Trikey… but his addon dont run correctly: make a inset with rwo faces of cube and the result is very weird!

Edit: I have desinstalled all my Blender 2.57b and re-open my computer. installed again Blender 2.57b official and nothing new: Your addon don’t be charged!

Edit2: Reload 3 times all scripts and this is the message of the console:

Info: Config directory with “startup.blend” file not found.
found bundled python: C:\PROGRA~1\BLENDE~1\Blender\2.57\python
Reloading: <module ‘bl_operators’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_operators_init_.py’>
Reloading: <module ‘bl_ui’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_ui_init_.py’>
Reloading: <module ‘keyingsets_builtins’ from 'C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\keyingsets_builtins.py
'>
gc.collect() -> 10187
Reloading: <module ‘bl_operators’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_operators_init_.py’>
Reloading: <module ‘bl_ui’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_ui_init_.py’>
Reloading: <module ‘keyingsets_builtins’ from 'C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\keyingsets_builtins.py
'>
gc.collect() -> 10480
Reloading: <module ‘bl_operators’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_operators_init_.py’>
Reloading: <module ‘bl_ui’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_ui_init_.py’>
Reloading: <module ‘keyingsets_builtins’ from 'C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\keyingsets_builtins.py
'>
gc.collect() -> 10472

Spirou4D
did you save the script as mesh_inset_extrude.py and only .py? it is quite common that people manage to save it as .py.txt
what happens if you paste the text in blenders text editor and press run script? can you then access “inset extrude” via the spacebar search

OK EVERY BODY, BLENDER HAS A GOOD PROBLEM WITH SCRIPTS THAT DON’T IS IN THE OFFICIAL ADDON FOLDER!

IF YOU CHOOSE A SECOND SCRIPT FOLDER AND YOU SET HIS LOCATION WITH THE FILE MENU OF THE PREFERENCE PANEL, BLENDER DON’T LOAD SOME SCRIPT. I DON’T KNOW WHY BUT IT’S SO.

JoS, YOU ARE A MASTER! YOUR ADDON IS A WONDER FOR AN ARCHITECT LIKE ME.
THANKS A LOT!

Edit: I have a second remark: If I copy a addon-extern folder in the official blender script folder with your inset extrude addon within. Blender don’t see your script but if i change the folder, i put your script in the addon folder, Blender see your script! why? I don’t understand?

It’s absolutely crazy! I can not more understand!
If i Reload all script, this is the console message:

found bundled python: C:\PROGRA~1\BLENDE~1\Blender\2.57\python
addon_utils.disable mesh_inset_extrude not loaded
Reloading: <module ‘bl_operators’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_operators_init_.py’>
Reloading: <module ‘bl_ui’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_ui_init_.py’>
Reloading: <module ‘keyingsets_builtins’ from 'C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\keyingsets_builtins.py
'>
gc.collect() -> 10453

And your script become desactivated!!!

This is the a complete debugging if you are interessed about:

found bundled python: C:\PROGRA~1\BLENDE~1\Blender\2.57\python

Traceback (most recent call last):
File “C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\addons\mesh_inset_extrude.py”, line 328, in draw_UI
blf.position(font_id, self.initial_mouse_region[0]+5, self.current_mouse_region[1]+8, 0)
File “C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\modules\bpy_types.py”, line 627, in getattribute
return super().getattribute(attr)
AttributeError: ‘inset_extrude’ object has no attribute ‘current_mouse_region’

trying to save homefile at C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\config\startup.blend ok

Traceback (most recent call last):
File “C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\modules\addon_utils.py”, line 259, in disable
mod.unregister()
File “C:\Users\Patrick\Downloads\BLENDER\Scripts_Archives_2.50\addons_contrib\io_import_fbx.py”, line 478, in unregister bpy.utils.register_class(ImportFBX)

AttributeError: register_class(…): already registered as a subclass

Reloading: <module ‘bl_operators’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_operators_init_.py’>

Reloading: <module ‘bl_ui’ from ‘C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\bl_ui_init_.py’>

Reloading: <module ‘keyingsets_builtins’ from 'C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\startup\keyingsets_builtins.py
'>

Traceback (most recent call last):
File “<string>”, line 1, in <module>
File “C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\modules\bpy\utils.py”, line 199, in load_scripts

_addon_utils.reset_all(reload_scripts)

File “C:\Users\Patrick\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\modules\addon_utils.py”, line 298, in reset_all
imp.reload(mod)
File “C:\Users\Patrick\Downloads\BLENDER\Scripts_Archives_2.50\addons_contrib\add_curve_sapling_init_.py”, line 34, in <module>
imp.reload(utils2)

NameError: name ‘utils2’ is not defined

location:<unknown location>:-1

location:<unknown location>:-1

BUT IT’S STRANGE: now your script run perfectly just I am changed the name of the addon folder:
addons-extern --> Addons-extern

MY QUESTION IS NOW RESOLVED
Edit: I have understand that the addons_contrib and Addons_extern don’t move out of the script Blender folder otherwise Blender don’t load the scripts correctly…

You are a hero man! Thank you for this useuseusefull tool!

Thanks man. Its a great tool :slight_smile:

JoS: Great tool! I guess many modelers will be happy with it. The code is also pretty easy to read, even without comments. Dare I say I recognise some of my own style in it? (turning off global_undo in an initialise function)
To address some of the issues you mentioned in the first post of this thread:

fix bug with tool panel not working
It’s a double bug as far as I can tell. The first one is minor: you forgot to include a return{‘FINISHED’} at line 430, end of the execute def. The second could be more problematic. It’s crashing at line 312, because you’re trying to access vertices that don’t exist. Remember: whenever you add or remove vertices, all indices could potentially be changed. Even of the vertices you didn’t alter. I was able to prevent a crash by adding a call to run_inset_extrude() before doing offset_verts. Unfortunately that produces weird results in interactive mode. However it might be a good starting point for your search of where to get the proper indices.

investigate slowdown in combination with subsurf modifier
You could temporarily turn off the subsurf modifier and use the data of the base mesh. I’m using object.to_mesh() in my LoopTools script for it, as toggling subsurf and using the existing mesh data doesn’t work. The reason is that the mesh data is only refreshed upon entering objectmode, so you’d have to toggle back and forth between object/edit mode which calls the modal() function, risking an eternal loop. Toggling object/edit mode is also very slow.
The only thing you need to keep an eye on with to_mesh() is that you remove the newly created meshes afterwards, so you don’t increasy the memory use.
For reference, in LoopTools I’m turning off mirror-modifiers in the get_derived_mesh() function and the cleaning is done at the end of nearly each operator class.

Ideas for future

  • I’d like the numeric input option you’re proposing. This is very useful especially when doing mechanical modelling.
  • Perhaps a percentual inset would be possible. This could also help with the sensitivity.
  • Make it impossible to inset beyond overlapping. Not certain if it’s a good idea to include this though as it could be really hard to calculate. For single faces it’s easy, but it could get very complicated with multiple faces. Besides, users can manually fix it by rotating on the correct axis.
  • Make the interactive inset direction not static, but dynamic. Currently, to the right is always a positive inset and up is always a positive extrude. This can be counter-intuitive to what is actually happening in the 3d-view. For instance, you’re dragging up but your selection moves down. A style that mimicks Blender’s own tools (grab, rotate, scale) might work better. So a dynamic movement direction (probably a bad term, but it’s hard to describe).

I was playing a bit with it and this is the result :slight_smile:

http://img833.imageshack.us/img833/7494/insetresult.png

I had a bit of trouble with recalculating the normals, since I have to do that every time I comfirm a inset with change in height (left click after ‘I’). As a suggestion: recalculate normals of whole mesh outside every time an your script runs. (I mean when insetting =) )

I didn’t experience any real bugs