# Adding extra functionality while publishing using shotgrid from a dcc

**URL:** <https://community.shotgridsoftware.com/t/adding-extra-functionality-while-publishing-using-shotgrid-from-a-dcc/16330>\
**Category:** Pipeline Integrations\
**Created:** [November 16, 2022, 12:58pm UTC](https://community.shotgridsoftware.com/t/adding-extra-functionality-while-publishing-using-shotgrid-from-a-dcc/16330 "2022-11-16T12:58:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloud](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@cloud](https://community.shotgridsoftware.com/u/cloud)\
**Post date:** [November 16, 2022, 12:58pm UTC](https://community.shotgridsoftware.com/t/adding-extra-functionality-while-publishing-using-shotgrid-from-a-dcc/16330/1 "2022-11-16T12:58:52Z")

</div>

Hello eveybody,

have a question 🙂,

> in the post\_phase.py
> 
> while traversing the tree
> 
> i am unable to get if the task is checked or not ,  
> for example in the post\_phase.py:

```auto
for item in publish_tree:
  for task in item.tasks:
    print("######################################################")
    print("POST FILES IN TASK -> %s"%task)
    print("######################################################")
    if task.settings["Export 3de4 to Mel"].value is True:
      print("is checked")

```

**the task returns the multipublish ui tasks including the one writes the mel script  
" Export 3de4 to Mel"  
but when i try to get the value it complains , any idea how to get if the task is checked or not**

```auto

```

> I figured out why the exportMel.py is publishing the script in the wrong place ,  
> “obviously the template path and the publish publishes the scene in this location”

**but if i could figure out why i could not get publish ui task value any help on this would be great**

> below is the original question i had posted:

while publishing from a dcc for example 3de4 ,  
we are adding implementation to export out a mel script (camera info and so forth) to a defined template path,

tried to follow the maya abc export function (in the acceptence phace it seems to ignore the mel part)

tried another way ,  
in the engine/multipublish2, under the dcc, created a Export 3de4 to Mel ui,

```auto
  - name: Export 3de4 to Mel
    hook: "{config}/tk-multi-publish2/publish_file.py:{engine}/tk-multi-publish2/basic/exportMel.py"
    settings:
      Publish Template: 3de4_shot_mel_export

```

the template is defined here as so

```auto
  3de4_shot_mel_export:
      definition: 'sequences/{Sequence}/{Shot}/{Step}/work/maya_export/{Shot}_{Step}[_{name}]_v{version}.mel'

```

Cheers

---

<div class="post-metadata">

**Author:** ![cloud](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@cloud](https://community.shotgridsoftware.com/u/cloud)\
**Post date:** [December 2, 2022, 11:57am UTC](https://community.shotgridsoftware.com/t/adding-extra-functionality-while-publishing-using-shotgrid-from-a-dcc/16330/2 "2022-12-02T11:57:51Z")

</div>

solved and task completed , with skgt.utils.publish method ,  
if this could help anyone 🙂
