Sharing my eyelid Component

mjcgmjcg Posts: 41
edited February 2016 in Kraken Rigging Framework

Hi guys,

I'ld like to share one of the components i've been working on for my Face Rig.
This is an "easy eyelid setup", basicly one controller per lid.

There's an unlimited number deformers available which you can set in the Component's Menu.
It also have the 'Eyeball_Offset' toggle option which tries to forces the deformers to keep the same distances from the eyeball.

Right know you have to use the 2 "Blink_Factor" Attributes on each Controls to fake the shape of the closed eyelid. In the future, once fCurve will be implemented in Fabric, i'll probably remove these 2 Attributes and add an fCurve Instead, so that you can have a full control on the closed eyelid's shape.

This is what you get out of the box with 10 deformers per Lid, with the default skin weights + a deltaMush on the Top :

The two DFG presets should be placed in %KRAKEN_DIR%\Presets\DFG\Kraken\Solvers\
Place the mjEyelid_Component.py in %KRAKEN_DIR%\Python\kraken_exemples\ or any custom path you have.

I'll upload all the other FaceRig Components once i'm done working on them :)

Maxime Jeanmougin

Comments

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭
    edited February 2016

    Thanks for sharing. This is looking very nice, great work.

    It is good you added the animated gif in your post so it shows what it's capable of and its intended use; it helped me understand how it would work.
    Had a quick look at building the components and rigs and it feels intuitive as a component, though I didn't test it on a model.
    Also good to see you actually build the solvers through a Canvas graph, makes me believe it's already greatly supported and I should start investigating it as well. ;)

    Seeing this activity with Kraken and people sharing around gives a glimpse of a bright future ahead, so thanks again for sharing your work!

  • EricTEricT Administrator, Moderator, Fabric Employee Posts: 305 admin

    @mjcg this is awesome! Can't wait to play with it! It looks awesome!

    Are you familiar with github, forking, and pull requests? If so you should submit this to be included in the main library (if that is OK with you).

    If not do you mind if I create it for you?

    I can make sure you get a dedicated folder for the solvers and the components too.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • mjcgmjcg Posts: 41
    edited February 2016

    @EricT @Roy Thank you Guys! Glad you like it !

    Please let me know if you find any strange behaviors.

    No Eric, I am not familiar with Github at all, nor with the code world in general, this is kind of the first time for me.
    I will create an account on Github tomorrow so that I can publish the faceRig Updates directly in the Kraken Repo.
    I'll let you know here once i'm ready and i might ask you what to do on gitHub so everything works correctly :)

    Here I keep my Components and Solvers separated from the Kraken Files, i have custom paths leading to my DFG folder, and call them like this :

    MJ.Kraken.Solvers.mjEyelidConstraintSolver
    MJ.Kraken.Debug.mjEyelidDebugSolver

    If you're willing to create folders within the main Kraken Lib, i don't mind having an "mjFace" folder were i can put my components.
    As for the solvers, I don't mind moving them all to %KRAKEN_DIR%\Presets\DFG\Kraken\Solvers\

    Maybe you could also add a 'Debug' folder in the DFG path, where i can put Debug related Presets ?

    Let me know what you prefer Eric, and i will adapt.

    Maxime Jeanmougin

  • EricTEricT Administrator, Moderator, Fabric Employee Posts: 305 admin

    If you get Kraken cloned to your new GitHub account and put your presets in a %KRAKEN_DIR%\Presets\DFG\MJCG\Solvers and your components in a %KRAKEN_DIR%\Python\kraken_examples\MJCG\ I think it would work really well.

    Let me know if you have any questions or need help.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • mootzoidmootzoid Fabric Employee Posts: 185 Fabric Employee
  • mjcgmjcg Posts: 41

    @EricT said:
    If you get Kraken cloned to your new GitHub account and put your presets in a %KRAKEN_DIR%\Presets\DFG\MJCG\Solvers and your components in a %KRAKEN_DIR%\Python\kraken_examples\MJCG\ I think it would work really well.

    Let me know if you have any questions or need help.

    I did a "Pull Request" on Github, i think everything should work.
    I had to copy-paste the text directly, is there any option to directly upload a file ?

    Maxime Jeanmougin

  • EricTEricT Administrator, Moderator, Fabric Employee Posts: 305 admin

    @mjcg You should technically be using Git to develop code and contribute back. I'd suggest installing Git and SourceTree and explore some online videos and documentation on how Git works. However this works just fine for now. Am going to check it out now.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • mjcgmjcg Posts: 41

    @EricT said:
    @mjcg You should technically be using Git to develop code and contribute back. I'd suggest installing Git and SourceTree and explore some online videos and documentation on how Git works. However this works just fine for now. Am going to check it out now.

    Alright, i installed the required the softwares, i tested to commit from them and it seems to work.
    I also fixed the things you've asked for inside the Component.
    One question, do i have to re-fork the main Kraken repo if i want to keep my fork up to date ?

    Also, i noticed a small bug inside the component. The numDeformers attributes from the component's menu does not seem to update back on its InputAttr when you build the guide. It stays at the default value (10), while there is not problem when you build the rig.

    I have no idea how to properly load these attributes to be used in the guide section.

    Maxime Jeanmougin

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭
    edited February 2016

    One question, do i have to re-fork the main Kraken repo if i want to keep my fork up to date ?

    No usually you don't re-fork. Instead you just pull the latest from upstream so you also have those changes.

    To make that work:

    Remotes

    What you can do is set another remote for your local clone. Usually where you forked from is called upstream (just convention people use).

    If you look in SourceTree under the Repository Settings for your cloned repository you should see a default remote called origin and this should hold the url to your own fork of Kraken. To also find changes and fetch/push/pull easily from the official fabric-engine/Kraken repo it's best to add another remote. To register the fabric-engine repository as upstream just add it (e.g. in sourcetree) with the git url for that repository.

    Once added you can click fetch to "refresh" so your local repository (and SourceTree) knows about changes that were made at origin and upstream. As such you'll start seeing when you're behind or in front of the latest commits (or working in parallel). Whenever you want to merge or update to the latest from upstream you pull from upstream. When this is done and it's merged you're basically up-to-date with the latest whilst including your locally committed changes. (Note that most of the time you should "commit" local changes you want to keep before pulling so these changes can merge)

    Terminology

    For me I think of the terminology of git like this:

    • remote: A path to another git repository
    • fetch: Refresh the latest information (commits) from the remotes
    • push: Upload local commits to elsewhere
    • pull: Download commits from elsewhere

    This also means that setting up a Pull Request is like telling someone to "download your changes". Funnily enough I had to explain this recently when working with a co-worker on a local git repository (not hosted on Github, Bitbucket, Gitlab or alike) and as such there is no "Pull request" feature. In such a situation a pull request is just your co-worker coming over to you and actually asking you to retrieve their latest changes. As such on Github a Pull request is nothing other than just pinging/asking to pull and merge your changes.

  • mjcgmjcg Posts: 41

    Hi @Roy Nieterau

    Thanks a lot for taking the time to explain all of this to me! I have to say, I felt a bit lost with the logic of SourceTree and all these terminologies. I was afraid that if I did not update the commits ahead from the Kraken repo, it would revert these modifications back once I push my commits there. I think I got it now!

    Basicly, If I want to update commits from my local dev folder, to my online repo, I just have to Push to origin.

    If then, I want to send these commits to the main kraken repo upstream, I just have to make sure to Pull commits ahead of mine from the main Kraken repo upstream, And only then, do a Push to Upstream only.

    since it is not my repo, @EricT will get a Pull Request that he will have to validate in order for my commits to be merged to the main Kraken repo.

    Did i get the logic right ?

    Thank you again for your help!

    Maxime Jeanmougin

  • Roy NieterauRoy Nieterau Posts: 258 ✭✭✭

    Basicly, If I want to update commits from my local dev folder, to my online repo, I just have to Push to origin.

    Exactly.

    If then, I want to send these commits to the main kraken repo upstream, I just have to make sure to Pull commits ahead of mine from the main Kraken repo upstream, And only then, do a Push to Upstream only.

    Theoretically you wouldn't have to pull their changes locally before you set up a pull request. Pulling locally first just means you're taking responsibility to merge your code with their latest code, otherwise the other one will be more responsible for it.

    Merging just means that you combine the code changes of both repositories. Sometimes there can be merge conflicts (e.g. two people worked on the same lines of code) and these need to be resolved. Applications/sites like SourceTree and Github provide a nice visual overview when that happens to easily allow you to resolve such conflicts with some human intervention (basically you choosing what you want to happen). As such merge conflicts are often resolved manually and that is the responsibility I'm referring to here.

    Note that you couldn't Push upstream since you don't have the necessary permissions to do that to the fabric-engine/Kraken repository. As such your Push will fail and setting up a Pull Request is your only option there to allow someone with permission to review your code and decide whether to merge or not.

    since it is not my repo, @EricT will get a Pull Request that he will have to validate in order for my commits to be merged to the main Kraken repo.

    How you phrased this it sounded as if you pushing upstream would result in a pull request. That's not the case. Pushing upstream would just fail. A Pull request is a different mechanism and is something Github, Bitbucket, etc. provides for you. (It's not a git feature by default as far as I'm aware of. You'll need a server that pings you about pull requests, like Github does.)

    Because the pull request is an feature (provided by the hosts, in this case Github) it's something you'd have to do through Github. As far as I know there's no actual git command to perform a pull request.

    And yes. Upon a pull request they can validate, discuss and decide whether to merge or not.

    Your logic seems alright and you're picking up nicely.

  • EricTEricT Administrator, Moderator, Fabric Employee Posts: 305 admin

    Thanks @Roy Nieterau for taking the time to explain this.

    As Roy said, you can't push to the main Kraken repo unless your'e on the Kraken dev team (only me, Phil, and the Fabric folks are). This is intentional so that we can review anything going back into the main branch. Just as I reviewed your original pull request and ask for a few changes. Pull requests are often a place to review (as the name suggests) thing that have been fixed, implemented, or changed.

    For submitting components, I first checkout your branch, run the code and see if it works. I also run our internal tests if someone has changed the core files to ensure all of our tests pass without issue. Once a review has been made, fixes implemented by the person submitting the code, then we merge it in.

    Once merged you can delete your branch and switch back to the main one (ours is develop2.X currently) and pull to get the latest version of the merged code. Maybe some other commits that have been made as well.

    Each feature, component, fix, or change should be done on its own branch and a pull request submitted. At times you'll see that I work directly on the develop2.X branch. Usually I do this as the changes are minor that I'm doing or they are small bug fixes. This is at my discretion as I'm one of the main devs. :)

    As Roy said as well, it seems you're picking up the terminology well and hope to see more contributions from you. It's very rewarding for me to see others using the system that I've worked on over the past few years. All the collaboration and discussions have helped aim the system in the right direction and helps us get to where we want to be even faster. Keep up the great work and many thanks for your contributions again.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • mjcgmjcg Posts: 41

    @Roy Nieterau said:
    Theoretically you wouldn't have to pull their changes locally before you set up a pull request. Pulling locally first just means you're taking responsibility to merge your code with their latest code, otherwise the other one will be more responsible for it.

    @EricT said:
    Once merged you can delete your branch and switch back to the main one (ours is develop2.X currently) and pull to get the latest version of the merged code. Maybe some other commits that have been made as well.

    Ok i think I get it. So technically, When i do a Pull Request, even if the Kraken Core files from origin are older than the files from Kraken/develop2.X, GitHub should automatically remove anything from my Pull Request that is older than the Kraken/develop2.X core files, and only changes on my Components and Solvers will be send in the Pull Request.
    Pulling locally first should not cause any conflict if I am the only contributor on my Conponents and Solvers (that is, only if i work on a custom branch).
    There can only be conflict if i work on files that are also being updated by other contributors. (e.g. the core files)

    Once Again, Thank you for these clarifications! @Eric , @Roy

    As Roy said as well, it seems you're picking up the terminology well and hope to see more contributions from you. It's very rewarding for me to see others using the system that I've worked on over the past few years. All the collaboration and discussions have helped aim the system in the right direction and helps us get to where we want to be even faster. Keep up the great work and many thanks for your contributions again.

    I will definitly keep updating the repo in the coming weeks. I want to make sure everything works without breaking before each commit.
    So far i love Kraken! I've been following the development for quite some time. Coming from Softimage, I was anxiously waiting the Fabric 2.0 Compatibility, so i only started exploring Kraken since 1.1.0
    It was a bit tough at first for me, as I have not so much expirience with code, but honnestly, building Components is actually quite easy with the help of your videos, and also all the other default Components.
    I hope that my contributions will make people want to use Kraken. For me it's definitly the right way to go :)

    Maxime Jeanmougin

  • anhungxadieuanhungxadieu Posts: 108

    nice work! thanks for share it! i wonder how i can create an directional constrain like your second image?

    Thụy Nguyễn
    CG Artist

  • mjcgmjcg Posts: 41

    Hi @anhungxadieu

    You're welcome! I haven't had the chance to finish the development of the full face rig for a long time, but i will definitly take some time to finish it.
    In the meantime you can take a look at the attached file, it's the Look At solver that is used if the GIF above, the setup is actually quite simple.

    Maxime Jeanmougin

  • anhungxadieuanhungxadieu Posts: 108

    thanks @mjcg, i'm learning Kraken, and going in the same way like you!

    Thụy Nguyễn
    CG Artist

Sign In or Register to comment.