Home Website Youtube GitHub

Strange line in mgear.component.Main.connectRef2()

I’m implementing my own ‘connect’ method based off of connectRef2 (which is being used in multiple components), and noticed this weird line (line 1387 in ./shifter/component/__init__.py):

rgn = self.rig.findRelative(“return the global ctl”)

I’m guessing it will never find a node in the scene by that name :grin:, and the following line will never return False.

Just thought I’d bring this forward, in case it was overlooked. But maybe it’s meant to be like that, too, for some reason?

2 Likes

Thanks for the feedback @Chris_Bullock I will check it

1 Like

@Chris_Bullock If I recall correctly is just forcing the method to return the global control. The string can be empty or anything non existing to force the recursion to go to the top control
Used that string as a memo :stuck_out_tongue:

1 Like

Is self.global_ctl not defined at this point? Why wouldn’t you just check against that, directly in that case?

:sweat_smile: good question :stuck_out_tongue: