Customising location/ side prefix

I'm trying to change the location/side prefix of my rig components. I've tried using the CustomConfig class in the custom_config module and also tried to change directly in the UI but both raise this error:

ValueError: Invalid location on: arm

Is it possible to change the side prefix or am I locked into L, R and M, I would like to customise it to l, r, c? I can't even change it to lower case, I can customise everything else with the CustomConfig class just not the side?
I'm just starting off in Kraken so it may be something that I have missed.

Tagged:

Comments

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

    Hey @fernoonoo,

    You will need to edit both the 'initColorMap' and 'initNameTemplate' sections of the Config. I've just tested myself and could set them to l, r, c lowercase and it worked.

    Keep in mind that many of the built in components have their locations set to L,R,M. I'm not exactly sure how to solve that problem though. Maybe if the default location in the component's class isn't found in the config, it should use a default value that also needs to be specified in the config. What do you think?

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • fernoonoofernoonoo Posts: 8

    Hi Eric,

    Thanks for your reply, I tried editing initNameTemplate and initColorMap in the CustomConfig sub-class. Did you edit the locations in the Config class itself?

    Regarding the built in components you are still passing in a location so could you pass in "L", "R" or "M" as you do currently and in the initNameTemplate locations could be a dict rather than list in which you could have 'L', 'R', and 'M' as keys and add your custom prefix as a value, e.g. default locations : {'L':'L', 'R':'R', 'M':'M'} and could be customised to {'L':'l', 'R':'r', 'M':'c'}? Also that would mean you wouldn't need to change the initColorMap or mirrorMap because you could ascertain your location from the key rather than the value of your location dict.

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

    @fernoonoo yes I edited the Config class itself. There shouldn't be a difference between the default config class and a sub-classed one. Are you setting the custom config in the build script / UI before building? I'll try to test with a custom config myself.

    Yes a dict would be possible though I am still unsure that would work as some may need to have additional locations such as UL (upper left) LL (lowerleft) and we can't compensate for all the cases.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • fernoonoofernoonoo Posts: 8

    I guess things like upper and lower could be added as part of the name string or descriptor, e.g name = "upperArm"?

    I'll try the Config class then, I was using the arm_build_with_custom_config.py as a template.

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

    I'm seeing the same issues here. Investigating now.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

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

    Ah I see the issue. Not really an issue just the sample test file that is throwing a wrench in things.

    The sample is testing the name template formats and is first calling the normal build with the default config. Then sets a new config, then builds the arm again to see the changes in naming.

    Since you change the config where L,R,M aren't valid any longer there is an error being printed that says the side isn't valid. You should copy the test file and remove lines 57 and 58. Everything should work from there.

    That said, the error message was pretty vague. I improved it and already pushed the update with better error information to the develop branch.

    See here:
    https://github.com/fabric-engine/Kraken/commit/f706ac8c75ed38323af3906b66f20148738947a8

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • fernoonoofernoonoo Posts: 8

    Hi Eric,

    It's all working well now, the only other node name that would be great to customise would be the parent and scale constraints, but I guess that's a bit more difficult as it's hard coded in the maya_plugin/builder file? Unless you could add a constraint key to the initNameTemplate method?

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

    That's a good suggestion. One thing to know is that Softimage can't name constraints so this is why it was left out. However there is no reason why we couldn't add it. We just added the KL / CanvasOp one. I'll add it in soon. Stay tuned.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

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

    @fernoonoo I've just added the ability to change the names of the constraints using the naming template.
    https://github.com/fabric-engine/Kraken/pull/428

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

Sign In or Register to comment.