# Adding new parameter to hook class method

**URL:** <https://community.shotgridsoftware.com/t/adding-new-parameter-to-hook-class-method/12345>\
**Category:** Pipeline Integrations\
**Created:** [May 10, 2021, 1:44pm UTC](https://community.shotgridsoftware.com/t/adding-new-parameter-to-hook-class-method/12345 "2021-05-10T13:44:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![doug\_bt](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@doug\_bt](https://community.shotgridsoftware.com/u/doug_bt)\
**Post date:** [May 10, 2021, 1:44pm UTC](https://community.shotgridsoftware.com/t/adding-new-parameter-to-hook-class-method/12345/1 "2021-05-10T13:44:28Z")

</div>

Good morning people!

I would like to add a new parameter to the _execute_ method, that’s inside scene\_operation-tk-maya, but I don’t see a way on how to retrieve this value, any tips or tricks to help? I did some research but couldn’t find any similar issues.

Thanks!

---

<div class="post-metadata">

**Author:** ![mmoshev](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/mmoshev/32/476_2.png) [@mmoshev](https://community.shotgridsoftware.com/u/mmoshev)\
**Post date:** [May 11, 2021, 6:59am UTC](https://community.shotgridsoftware.com/t/adding-new-parameter-to-hook-class-method/12345/2 "2021-05-11T06:59:24Z")

</div>

The question is not completely clear. If you subclass the scene operation hook, you can change its parameters as you wish. How are you passing that new parameter, though? This would be called from `tk-maya`, so are you using a forked engine to do that?  
Also, you could use [kwargs](https://book.pythontips.com/en/latest/args_and_kwargs.html) (which you can see as the last parameter) to add arbitrary named arguments in a dict.

---

<div class="post-metadata">

**Author:** ![doug\_bt](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@doug\_bt](https://community.shotgridsoftware.com/u/doug_bt)\
**Post date:** [May 11, 2021, 2:07pm UTC](https://community.shotgridsoftware.com/t/adding-new-parameter-to-hook-class-method/12345/3 "2021-05-11T14:07:16Z")

</div>

@mmoshev Thanks for the reply!! Yep sorry I wasn’t clear, that was the real question how would I be able to pass this new parameter from x to this _execute_ function

---

<div class="post-metadata">

**Author:** ![mmoshev](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/mmoshev/32/476_2.png) [@mmoshev](https://community.shotgridsoftware.com/u/mmoshev)\
**Post date:** [May 11, 2021, 2:20pm UTC](https://community.shotgridsoftware.com/t/adding-new-parameter-to-hook-class-method/12345/4 "2021-05-11T14:20:40Z")

</div>

The hooks are triggered in the [engine](https://github.com/shotgunsoftware/tk-maya/blob/master/engine.py) and corresponding apps. I am not familiar with `tk-maya` to provide more info. From a quick look, the engine does not fire additional hooks, so maybe relies on the superclass implementation for that.
