Page 1 of 2 12 LastLast
Results 1 to 20 of 29
  1. #1
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290

    [ADDON][MostlyComplete]Add Grating

    There have been several projects that I have needed metal grating for and it takes a lot of time to create, so as my first real addon I created a script to automate all this. You can adjust width, length, number of slates width wise and length wise, height, and thickness. All normals seem to be looking ok, only problem that I know of is the fact you can make the thickness larger than the spacing between slates. Leading to some ugly results. Still looking for a way to easily correct that. Suggestions are welcome. Here is the link to the download

    EDIT 8/30/14 version 0.2:
    I update the script, you can now rotate while adjusting the properties. Also made lengths up to 2000 in possible. Also noticed that at 60" x 1200" with 12 width slates and 150 length slates the face count was around 17,000. A lot of faces for just grating, but that is a pretty big example. New script here

    EDIT 8/31/14 version 0.3:
    Added button to Create panel, under new heading called "Addons". Fixed some normal issues, so all normals are now good. Hope to for next update fix problem were thickness can be larger than distance between slates. Causing a mess. Here is the current version, I will update it once I fix the thickness issue. UPDATE: thickness issue fixed, changed so smallest length is 1 inch

    EDIT 9/7/14 version 0.4:
    Fixed inner faces issue. Link here

    EDIT 10/9/14 version 0.4:
    Updated the panel, to add to the View3D > Toolbar > Create > Addons panel you now need this script.
    Link in above post has been update to adjusted grating script
    Last edited by Jacob Morris; 09-Oct-14 at 14:47.



  2. #2
    Member Spirou4D's Avatar
    Join Date
    Jul 2010
    Location
    Lille, France
    Posts
    1,257
    Hi Jacob Morris,

    Thanks for sharing your job for add-on.
    WARNING:
    But your add-on don't run because you have keeped the main function in comment!

    And with the conventionnal name in python file for Blender:
    - no capital-> add.mesh.grating.py like Blenderfoundation.

    grating.PNG

    Congrats.
    Spirou4D
    Last edited by Spirou4D; 30-Aug-14 at 11:16.
    Words are Images that loosed Light!
    Linux Mint 18.2 Saunya - Bi-Quad Intel 2.66Ghz x64Bytes - Nvidia OpenGL GT 630 4Go-vram



  3. #3
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290
    I updated the name and the link in my first post, I have the last lines commented out because they are just for running the script from the text editor. As an addon it works fine for me.



  4. #4
    Member
    Join Date
    Jan 2014
    Location
    Dresden
    Posts
    725
    Great Tool!
    But it does not work.

    #if __name__ == "__main__":
    #register()

    You have forgotten to delete the rhombus at the line beginning.

    if __name__ == "__main__":
    register()

    I think it will be good to have all new Mesh Plugins in a new Panel under the Create TAB
    > not in Add Mesh alone.
    Show this Thread > http://www.blenderartists.org/forum/...38#post2718238

    thx for sharing!
    Last edited by mkbreuer; 31-Aug-14 at 10:24.



  5. #5
    Member Spirou4D's Avatar
    Join Date
    Jul 2010
    Location
    Lille, France
    Posts
    1,257
    Thks mkbreuer,

    > new Panel under the Create TAB
    it's a nice idea....I save the code for me.
    Bye bye
    Words are Images that loosed Light!
    Linux Mint 18.2 Saunya - Bi-Quad Intel 2.66Ghz x64Bytes - Nvidia OpenGL GT 630 4Go-vram



  6. #6
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290
    that is really odd, I have the lines commented out and it works just fine for me as a plug-in. I thought that those lines were only needed to get the code to run from the text editor, but as a plug-in you didn't need them. And I will look into add it to the Create tab, thanks for the suggestion.



  7. #7
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290
    Added button to View3D > Tools > Create > Addons, also fixed some normal issues, link here and in first post.
    Last edited by Jacob Morris; 01-Sep-14 at 14:03.



  8. #8
    Member
    Join Date
    Jan 2014
    Location
    Dresden
    Posts
    725
    Works well! thx

    (...sorry for my bad english. It was more a suggestion than an idea. Thinking and writing does not always mean the same thing.)



  9. #9
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290
    @mkbreuer it was no problem.



  10. #10
    Member PyroGXPilot's Avatar
    Join Date
    Jul 2011
    Location
    TILLAMOOK, OR
    Posts
    749
    Hrm a thread w/o screenshots!



  11. #11
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290
    Some example pictures:
    It adds another section to the Create panel:
    Attachment 330697
    UI:
    Attachment 330698
    Default settings:
    Attachment 330699



  12. #12
    Member SaltyCowdawg's Avatar
    Join Date
    Aug 2013
    Location
    Tinton Falls, NJ
    Posts
    190
    Traceback (most recent call last):
    File "/home/peter/.config/blender/2.71/scripts/addons/add_mesh_grating.py", line 176, in execute
    self.over_width, self.width_num, self.over_length, self.length_num, self.thickness, self.height, self.rotation)
    File "/home/peter/Blender/blender-2.71-ee8dafe-linux-glibc211-x86_64/2.71/scripts/modules/bpy_types.py", line 584, in __getattribute__
    return super().__getattribute__(attr)
    AttributeError: 'MESH_OT_primitive_grating_add' object has no attribute 'rotation'


    location: <unknown location>:-1
    Peter L. Berghold BBQ Fanatic, Dog Trainer, Beer Brewer
    and aspiring Science Fiction author.
    Started working with Blender in July of 2013 so I'm still learning



  13. #13
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290
    Originally Posted by SaltyCowdawg View Post
    Traceback (most recent call last):
    File "/home/peter/.config/blender/2.71/scripts/addons/add_mesh_grating.py", line 176, in execute
    self.over_width, self.width_num, self.over_length, self.length_num, self.thickness, self.height, self.rotation)
    File "/home/peter/Blender/blender-2.71-ee8dafe-linux-glibc211-x86_64/2.71/scripts/modules/bpy_types.py", line 584, in __getattribute__
    return super().__getattribute__(attr)
    AttributeError: 'MESH_OT_primitive_grating_add' object has no attribute 'rotation'


    location: <unknown location>:-1
    Did you get this on import of the addon? Or upon running it? What version of blender are you running? Thanks



  14. #14
    Member SaltyCowdawg's Avatar
    Join Date
    Aug 2013
    Location
    Tinton Falls, NJ
    Posts
    190
    Originally Posted by Jacob Morris View Post
    Did you get this on import of the addon? Or upon running it? What version of blender are you running? Thanks
    Blender 2.71

    This occurred when I attempted to run it (add a grating that is)
    Peter L. Berghold BBQ Fanatic, Dog Trainer, Beer Brewer
    and aspiring Science Fiction author.
    Started working with Blender in July of 2013 so I'm still learning



  15. #15
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290
    That is really odd, I played around with it and couldn't get an error, although I get some pretty funky results from when I was in Edit Mode, so I made it so that it won't add unless in object mode. Get the latest version here, or in update 0.3 from main post.



  16. #16
    Member
    Join Date
    Apr 2012
    Location
    Pennsylvania, USA
    Posts
    290
    Added ability to have to slates in middle, so you can use this for easily controllable frames, link in above post and in update 0.3 in main post



  17. #17
    Member polygonesrus's Avatar
    Join Date
    Apr 2012
    Location
    NEW JERSEY , AMERICA
    Posts
    156
    nice ,gonna come in handy. Thanks



  18. #18
    Convenient (and works nicely in Win64 2.71 here ^_^)... but, there's something slightly odd about the mesh it generates - visible when you try to bevel the inner edges. Perhaps there are some generated internal faces that shouldn't be there? (alternatively, maybe add a "Bevel Amount" setting to the panel?).

    In the following image, the blue was made manually and bevelled (to check that the 5-pole corners weren't confusing the Bevel tool), while the grey one shows glitches at some corners...

    screen.png

    (EDIT: 'Select -> Interior Faces' shows that there's an extra face on each 'hole' of the grating, that probably shouldn't be there...).
    Last edited by mfm; 05-Sep-14 at 18:50.



  19. #19
    The addon generates inner faces. Then remove the interior faces.
    I use MeshLint for this.



  20. #20
    Member SaltyCowdawg's Avatar
    Join Date
    Aug 2013
    Location
    Tinton Falls, NJ
    Posts
    190
    Originally Posted by Jacob Morris View Post
    That is really odd, I played around with it and couldn't get an error, although I get some pretty funky results from when I was in Edit Mode, so I made it so that it won't add unless in object mode. Get the latest version here, or in update 0.3 from main post.
    I'm wondering if it is a windows vs. Linux thing... I run Linux Mint 15
    Peter L. Berghold BBQ Fanatic, Dog Trainer, Beer Brewer
    and aspiring Science Fiction author.
    Started working with Blender in July of 2013 so I'm still learning



Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •