Home Technical Talk

[Maya] GN Quad Fill Hole

polycounter lvl 9
Offline / Send Message
Gabriel Nadeau polycounter lvl 9


Update version 2.01:

Hello!
I just updated my script on ArtStation which now comes with a new option "Force offset" that might help achieve a better result in certain situations. Basically, as you can see in the animation below, if you check this box, an offset will be applied to the Quad Fill Hole no matter what.



Update version 2.0:

Hi everyone!
I've just updated my script on ArtStation with some cool new features.
Basically, I've improved the script overall functioning and made it preserve your object transforms and pivot.
Also, the script now comes with an option box that contains a couple of additional options that you will find listed below with some new examples of the script in action.

UI:


OPTIONS:
Alternate action: This option will allow you to choose an alternate action to perform in situations where the quad filled hole is not possible.
Add inset: This option will allow you to add an inset to the filled hole, with a slider controlling the size of the inset.
Offset: This option will allow you to shift the quad filled hole by one unit, which can help get a better result in some situations.

DEMO 1 - ALTERNATE ACTION / OFFSET:


DEMO 2 - INSET:


DEMO 3 - TRANSFORMS & PIVOT:


DEMO 4 - IRREGULAR SHAPES:


Version 1.0:

Hi everyone!
I've been learning to script in my spare time for some time now and I decided to share with you my latest script which is called GN Quad Fill Hole that I created mainly to cap cylinders with an even quad topology. Below are a couple of examples of the script in action:




The script is very basic and won't take into account the curvature of the object, it's really meant to just replicate the current Fill Hole operation in Maya but with a quad toplogy instead of just a ngon face. Also, the script has a couple of limitations that I might try to improve in the future. For example, it will only work with certain type of holes and the script will delete the object transforms and history. Below you will see examples of the limitations and how to work around it:



The script is available on my ArtStation store: https://www.artstation.com/gabrielnadeau/store/dRAM/maya-gn-quad-fill-hole
Let me know your thoughts and feel free to contact me if you encounter any bug or you think that something could be improved/changed.

Cheers!
Gabriel

Replies

  • Dukefleed
    Options
    Offline / Send Message
    Dukefleed polycounter lvl 7
    Hi!
    nice script!
    Works on mac maya 2018 with little hack: 
        -rename GN-QuadFillHole.mel as GN_QuadFillHole.mel
        -mel command to execute: source GN_QuadFillHole.mel; GN_QuadFillHole; (not GN_QuadrangulateFace;)
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi Dukefleed!

    Thank you for reporting back.
    You're right about the command to use, I put the wrong one in the instructions.
    I updated the files with the correct one.
  • Slyvin
    Options
    Offline / Send Message
    I install the tool in maya 2020, but it doesn t work. It s posible to help me. Thank you :)
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi @Slyvin

    I'd like to help you, but I don't really have enough information right now.
    Can you tell me what happens when you run the command, do you have an error or something?
    Make sure to follow carefully the instruction on how to install and use the script in the READ-ME.txt file that comes with it and then everything should work fine.
  • Slyvin
    Options
    Offline / Send Message
    Great, I made a mistake. I put a wrong order. Thank you very much. It works 

  • RedMASK
    Options
    Offline / Send Message
    RedMASK polycounter lvl 6
    Hi, this looks nice.
    Any plans for future like adding to work on curvature surface?
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9

    I fear like a feature like this would be very challenging to make and it's not really on my plan for the near future, but maybe someday I'll try to work something out.
  • RedMASK
    Options
    Offline / Send Message
    RedMASK polycounter lvl 6
    Hi @Gabriel Nadeau

    I know :) .... no one has done it.
    Anyway tnx ,and keep up with good work.
  • Matfreitas
    Options
    Offline / Send Message
    I install the tool in maya 2020, but it doesn t work. It s posible to help me. Thank you !
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi @Matfreitas

    I'd like to help you, but I would need more details to do so.
    Can you tell me exactly what version of my tool that you're trying to install and what happens when you run the command?
    Do you have any error that you could share with me, so that I can troubleshoot this issue.

    Thank you,
    Gabriel
  • Matfreitas
    Options
    Offline / Send Message
    Hi @Matfreitas

    I'd like to help you, but I would need more details to do so.
    Can you tell me exactly what version of my tool that you're trying to install and what happens when you run the command?
    Do you have any error that you could share with me, so that I can troubleshoot this issue.

    Thank you,
    Gabriel
    Quad fill v4 01. in maya 2020 . cmdline # Error: unexpected indent. 
    Can you provide me a old version? 


  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi @Matfreitas

    I'd like to help you, but I would need more details to do so.
    Can you tell me exactly what version of my tool that you're trying to install and what happens when you run the command?
    Do you have any error that you could share with me, so that I can troubleshoot this issue.

    Thank you,
    Gabriel
    Quad fill v4 01. in maya 2020 . cmdline # Error: unexpected indent. 
    Can you provide me a old version? 


    Did you make sure that you typed the command correctly with no space (indentation) at the beginning?
    You can also just copy & paste the command below in the Python command line and it should work.
    import GN_QuadFillHole
    GN_QuadFillHole.QFH_Window(optionBox=True)

    You will also find the commands to use in the file READ-ME.txt that comes with the script.
  • Matfreitas
    Options
    Offline / Send Message
    Hi @Matfreitas

    I'd like to help you, but I would need more details to do so.
    Can you tell me exactly what version of my tool that you're trying to install and what happens when you run the command?
    Do you have any error that you could share with me, so that I can troubleshoot this issue.

    Thank you,
    Gabriel
    Quad fill v4 01. in maya 2020 . cmdline # Error: unexpected indent. 
    Can you provide me a old version? 


    Did you make sure that you typed the command correctly with no space (indentation) at the beginning?
    You can also just copy & paste the command below in the Python command line and it should work.
    import GN_QuadFillHole
    GN_QuadFillHole.QFH_Window(optionBox=True)

    You will also find the commands to use in the file READ-ME.txt that comes with the script.


    I made a mistake.. Thank you very much. It works . Great tool
  • ManiSalguero
    Options
    Offline / Send Message
    Hi! 
    I am trying to install the plugin, but It's not working.

    I pasted in maya 2019 and 2022 scripts folder.
    After I pasted the command.
    And when I'm in maya I got a "syntax error":
    What I'm doing wrong?
    Hope that you can help me, and thank you! :D 


  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi @ManiSalguero

    You didn't enter the command properly.
    There are two different commands that you can use, one that will run the script with the current options and the other one to open the window and change the options.

    Command #1:
    import GN_QuadFillHole
    GN_QuadFillHole.QFH_Window(optionBox=False)

    Command #2:
    import GN_QuadFillHole
    GN_QuadFillHole.QFH_Window(optionBox=True)

    You can just copy & paste the commands above and it should work.
    Make sure to copy only the commands and nothing else.

    Thank you,
    Gabriel
  • ManiSalguero
    Options
    Offline / Send Message
    Hi @ManiSalguero

    You didn't enter the command properly.
    There are two different commands that you can use, one that will run the script with the current options and the other one to open the window and change the options.

    Command #1:
    import GN_QuadFillHole
    GN_QuadFillHole.QFH_Window(optionBox=False)

    Command #2:
    import GN_QuadFillHole
    GN_QuadFillHole.QFH_Window(optionBox=True)

    You can just copy & paste the commands above and it should work.
    Make sure to copy only the commands and nothing else.

    Thank you,
    Gabriel
    My mistake! Thank you so much! :D 


  • janoshx
    Options
    Offline / Send Message
    janoshx polycounter lvl 6
    I get error message in maya 2022. In maya 2020 this works. Tried the latest version from artstation shop


    # Error: SyntaxError: file C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py line 142: (unicode error) 'unicodeescape' codec can't decode bytes in position 410-411: truncated \UXXXXXXXX escape # 

  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi @janoshx

    Thank you for letting me know about this error.
    I've just released a new update on the ArtStation store, it should work properly now.
    Please let me know if you have any other issue.

    Thank you,
    Gabriel
  • devingeesr
    Options
    Offline / Send Message
    devingeesr polycounter lvl 13
    Hello hope all is well I recently tried the script in Maya 2022 and I keep getting a syntax error: 

  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi @devingeesr

    Which version of the script are you using?
    Make sure to use the latest version 4.07 and everything should be good.
    Let me know if you still have an error with the latest version and I will investigate further.

    Thank you,
    Gabriel
  • devingeesr
    Options
    Offline / Send Message
    devingeesr polycounter lvl 13
    @Gabriel Nadeau Hello thank you for the response I downloaded the latest version today. And I was still giving me the error I will check again. 
  • devingeesr
    Options
    Offline / Send Message
    devingeesr polycounter lvl 13
    @Gabriel Nadeau After testing the script in 2020 it worked but it did not work in 2022.  I installed the 4.07 version of the plugin.
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    @devingeesr

    What do you mean it doesn't work. You still have a syntax error?
    By the way, I just noticed in your screenshot that you're not using the right command.
    The command was changed in one of the newer version for this one:
    import GN_QuadFillHole
    GN_QuadFillHole.GN_QuadFillHole(optionBox=True)
  • devingeesr
    Options
    Offline / Send Message
    devingeesr polycounter lvl 13
    Yes, I'm still getting the same error in Maya 2022.  I copied and pasted the code you posted and I'm still getting the error. 

  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Can you open the Python file in a text editor and check the first couple of lines to make sure that you are indeed using version 4.07?

    If so, I would suggest to completely reset your Maya preferences and reinstall the script.
    You can reset the preferences by deleting the following folder:
    %userprofile%\Documents\maya

    Hopefully, that will resolve your issue, because otherwise I am not sure what else I can do as I'm currently unable to replicate your error and I haven't heard of anyone else having this issue with the current version.
  • devingeesr
    Options
    Offline / Send Message
    devingeesr polycounter lvl 13
    @Gabriel Nadeau  Thank you looks like deleting the preferences worked.
  • Henrik
    Options
    Offline / Send Message
    Can you open the Python file in a text editor and check the first couple of lines to make sure that you are indeed using version 4.07?

    If so, I would suggest to completely reset your Maya preferences and reinstall the script.
    You can reset the preferences by deleting the following folder:
    %userprofile%\Documents\maya

    Hopefully, that will resolve your issue, because otherwise I am not sure what else I can do as I'm currently unable to replicate your error and I haven't heard of anyone else having this issue with the current version.
    @Gabriel Nadeau  Thank you looks like deleting the preferences worked.
    I'm in the same boat as @davingeesr was . If I delete my prefs, is there any way to backup and restore my prefs, or is the syntax error likely to return once restoring back to old prefs? (I have lots of pref tweaks that would take ages to keep track of.)
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9

    Unfortunately, I do not know of any way to do what you're looking for.
    You should at least make a backup of the folder before deleting it, and then test to make sure the script is working with the fresh preferences. If that fixes the error, then I'm afraid you will have to rebuild your preferences manually from there. If it doesn't, then you can go back to your old preferences and let me know, so I can investigate further.

    However, there are probably some elements that you can recover safely from your old preferences, such as your hotkeys, shelves and colors.
    Maybe you can get rid of this error by just deleting the file "userPrefs.mel" and restart Maya.
    Just make a backup and go trial and error to see what you have to delete and what you can keep.

    Example:


    Hope this helps,
    Good luck!

    Gabriel
  • Henrik
    Options
    Offline / Send Message

    However, there are probably some elements that you can recover safely from your old preferences, such as your hotkeys, shelves and colors.
    Maybe you can get rid of this error by just deleting the file "userPrefs.mel" and restart Maya.
    Just make a backup and go trial and error to see what you have to delete and what you can keep.
    Sorry, Gabriel. Didn't see this reply until after replying to your email. Ok! I'll try these methods as soon as I get a chance and report back if I discover that it wasn't caused by borked preferences. Again, appreciate taking your time to provide such a detailed reply.
  • haukakei
    Options
    Offline / Send Message

    Hello @Gabriel Nadeau, I'm using Maya 2020 with QuadFillHole ver. 4.11. Yet I still got this syntax error. I have deleted and reset the maya pref but it didn't help.😥

  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9

    Hi @haukakei


    Thanks for letting me know about this error.

    I just published a new update on ArtStation (v4.12) which should fix this.

    Please let me know if you ever encounter another error.


    Thank you,

    Gabriel

  • haukakei
  • Weenail
    Options
    Offline / Send Message

    Hi there!

    I am using Maya 2023 and the import does not work. Please see the attached


  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9

    Hi @Weenail

    I don't understand, which version of the script are you even using?

    It looks like you're using an old command to run the script, but it has been changed for some time now as noted in the documentation.

    My recommendation would be to reinstall using the latest version (v. 4.12) and follow the instructions carefully on the documentation page:


    Thank you,

    Gabriel

  • Axcel
    Options
    Offline / Send Message
    Axcel polycounter lvl 14

    Great work with the script Gabriel!


    Is it possible now or in the future to make adjustments after executing procedure of filling up?

    I looked at the attribute editor panel, but there is no new tab with the settings there.

    I'm on 4.05 (newest available on ArtStation or Gumroad as of Dec 2022).


    Thanks,

    DS

  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9

    Hi @Axcel ,


    No it's not possible right now and I agree it would be really nice if it could behave this way, but I fear it's very complicated to implement and I don't think my script is really suited to work like that at the moment as it would probably be very slow to recalculate every time an option is changed.

    I'll take note of it anyway, but I doubt to add something like this anytime soon, unfortunately.


    I hope you understand.


    Thank you,

    Gabriel

  • MALEEWICH
    Options
    Offline / Send Message
    Hi there!
    Got troubles with optionBox. Doesnt work while arg in. Maya 2023
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    It looks like you're using the correct command, so I don't understand why it wouldn't work.

    Maybe you're using an older version of the script? The commands used to be different on older versions, so make sure you have the latest one (v.4.15).
    I don't see any other reason why it wouldn't work.
  • MALEEWICH
    Options
    Offline / Send Message
    I’m using the latest version. It works for me in Maya 2022 but not in 2023 :(
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    @MALEEWICH
    I would suggest to fully reset your Maya preferences and reinstall the script and hopefully it will resolve your issue.
    To reset your preferences, you can check the following instructions: https://help.autodesk.com/view/MAYAUL/2023/ENU/?guid=GUID-393D1ECA-9B6E-4625-B5B1-3F28E62AFB1C
  • UbiBubi
    Options
    Offline / Send Message
    UbiBubi polycounter lvl 2
    Hello! Using v4.15 on maya 2024 on Windows 10 and it won't work for me :( I attached photos of the install location, command used, and error received. I get the corresponding error for the false command i.e. invalid use of Maya object "False". Any help?

     
  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi @UbiBubi
    You're supposed to enter the command with Python not MEL.
    That's why it's not working.  :p
  • UbiBubi
    Options
    Offline / Send Message
    UbiBubi polycounter lvl 2
    Thanks for replying so fast! I'm not used to working with MEL or python if that hasn't already become clear  :# it's working just fine now thank you again
  • Senyr
    Options
    Offline / Send Message
    good day Gabriel Nadeau

    can you help me with this little problem,
    may i didn't do something good with the line command or something else
    I think it's the same problem with two scripts I'm doing wrong  :s



  • Gabriel Nadeau
    Options
    Offline / Send Message
    Gabriel Nadeau polycounter lvl 9
    Hi @Senyr

    You're not placing the files in the right location.
    As stated in the documentation, they should be placed in the following directory:
    C:\Users\<username>\Documents\maya\<version>\scripts

    Then, just restart Maya and everything should work fine.
  • Senyr
    Options
    Offline / Send Message
    hi Gabrielle

    thank you for fast response,
    yeah was My mistake  :#
    thank you, all worked   =)
Sign In or Register to comment.