Search - User list
Full Version: Shotgun find Output
Root » PDG/TOPs » Shotgun find Output
Clément HECTOR
Hello,

Can you help me to get the result of the shotgun find output. I can see anything in work_item.data.allDataMap or parent_item.data.allDataMap.

Thank you
guilhermecasagrandi
Hi Clément, how did you setup SG to work with TOPs? I can´t find a way to make it work. Thanks and sorry to use your post to ask a different question.
Clément HECTOR
Hi,

You have to set the environment variables PDG_SHOTGUN_LOGIN to your Shotgun username, PDG_SHOTGUN_PASSWORD to your Shotgun password and PYTHONPATH to the shotgun api path. Normaly after that your shotgun session node should work.

Clement
guilhermecasagrandi
Yeah, I´ve added them, but I´m still getting errors (houdini doesn´t find the path to the API). In my “PYTHONPATH” variable (on the system), I added the path to “\\python-api\\shotgun_api3”. Is that correct?
Clément HECTOR
Can you “import sgtk” in python shell?
guilhermecasagrandi
Yes, inside houdini´s python shell I can. I´ve shotgun running and SG python tab open inside houdini. But I still get error´s saying that Houdini can´t find SG API. As I posted, I pointed out the “PYTHONPATH” environment to the “shotgun_api3” folder. Is that correct? Do I need to add extra folders to the environment?

Got it. Was a problem with the pythonpath. Thanks for the help, and I hope someone can help you too!
BrookeA
Clément HECTOR
Hello,

Can you help me to get the result of the shotgun find output. I can see anything in work_item.data.allDataMap or parent_item.data.allDataMap.

Thank you

The reason that you can't find the output in the data map is that the Shotgun node is attaching the output as result data, which is a separate entity from the attribute data.

If you want to extract the information in the Python Script node and attach the information as attributes, you could do something like this:

entity_types = pdg.resultData(parent_item, "shotgun/find_entity_type", as_list=True)
entity_dicts = pdg.resultData(parent_item, "shotgun/find_entity_dict", as_list=True)
entity_ids = pdg.resultData(parent_item, "shotgun/find_entity_id", as_list=True)

for x in xrange(0, len(entity_ids)):
work_item.data.setInt("entity_ids", int(entity_ids[x]), x)
work_item.data.setString("entity_types", entity_types[x], x)
work_item.data.setString("entity_dicts", entity_dicts[x], x)

This will grab 3 distinct lists of result data from the upstream work item, where each list corresponds to a tag. It then iterates over the number of returned entities, and adds the information as attributes.
Clément HECTOR
Thanks a lot! That's exactly what I wanted. I just have to put the results in different index, thanks again.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB