Home Youtube GitHub

Auto reload components


#1

I find myself reloading the components very often when developing on them.

Maybe we should implement automatic reload of the components on building?


#2

Not sure about this idea. The performance penalty if this is done each time a component build.
Also here at the studio the network is a little saturated and can add a few seconds to each build.

Maybe as an option for development is a good idea. but not as default behaviour.

Side note: I was thinking that we need sooner than later some storable configuration for mgear. So the user can adapt the default to what he needs


#3

Sorry yeah, meant it for component development mostly.

Maybe we can store a “Reload components on build” option on the guide settings?


#4

yep that is an option

BTW: We already have some flags for development. Maybe in WIP mode can trigger this behavior
image
image


#5

Sure, that could be the way to go.


#6

What does the WIP mode do currently?


#7

is just a flag that you can use for anything you wish.
If I recall correctly I am using it on leg_3joint to hide or show some joints used for the ik spring solver.


#8

@Toke_Stuart_Jepsen The WIP and FINAL modes are there for you to create two different configurations when building your own shifter componets. If I am not mistaken most of the current Shifter component don’t have that much config difference when building in WIP or Final but @Miquel know way better on this matter than I do but I do plan differenciate a lot on some components that I am writting as Wip mode on my side is like an unlocked verison of the rig with everything exposed for triggers as Final is the opposite with lots of things hidden and locked.

Another thing is that the Steps does execute on the order that you see on the list. This means that if you are creating the Objects you won’t have the Joints (please @Miquel correct my statements if I am wrong).

Cheers


#9

@Jerome it is correct

the steps correspond with the methods for each component creation
That is the reason we have “custom steps” because this are the default normal “steps”


#10

Would it give greater flexibility for developers if reloading the components wasn’t tied to the WIP mode?

With an option on the guide settings, it’ll become independent from the modes so developers can use it however they want.


#11

I guess it depends on how you look at it. Yes, more options give more flexibility but also you can end with many options/flags to turn on/off


#12

Is there a way to query the mode of the build in post scripts?


#13

@Toke_Stuart_Jepsen yes all values in the build should be possible to query.

try with this: stepDict["mgearRun"].options["mode"]


#14

Where do you get stepDict from?


#15

@Toke_Stuart_Jepsen are you creating your post scripts manually?

If you create them with the “New” button in the guide settings Custom Steps tab, then it creates a file that has some boiler-plate code. And that is where stepDict comes from.

import mgear.shifter.custom_step as cstp


class CustomShifterStep(cstp.customShifterMainStep):
    def __init__(self):
        self.name = "temp"


    def run(self, stepDict):
        """Run method.

            i.e:  stepDict["mgearRun"].global_ctl  gets the global_ctl from
                    shifter rig on post step
            i.e:  stepDict["otherCustomStepName"].ctlMesh  gets the ctlMesh
                    from a previous custom step called "otherCustomStepName"
        Arguments:
            stepDict (dict): Dictionary containing the objects from
                the previous steps

        Returns:
            None: None
        """
        return

#16

Ahh, I see. Yup, was creating them manually.


#17

also to get any object or attr from a components, you can do the following:

stepDict["mgearRun"].components["spine_C0"]

This give you access to the spine_C0 component