Hello,
Many thanks for the useful feedback everyone. I managed to finally get some time to work on this and was successful in getting it to work. That’s thanks to you folks!
I went with @Munkybutt approach to compare the root of the path to the root of the workspace.
I did try to use @Mambo4 command to (p4 -c clientName where Path/to/file.ext) but that failed
So here’s a break down of those commands:
p4_instant = P4()
p4_instant.connect()
user_name = p4_instant.user
# This got my clients from the below command which created a dic to which I used ["clients"] key to access the client names. Below shows this
client_list = p4_instant.run("clients", "-u", user_name):
# Tried to check my maya scene path with my clients but it failed. I must be using the run command with the wrong console command layout. Below shows my failed attempt
p4_instant.run( "-c", f"{clientName} where", maya_scene_filepath):
# Note: clientName is a arg taken from the dic key["client"]
As I mentioned, I eventually went with querying the client root path to the maya filepath! Wrapped it all up in class methods! Job done.
Thanks once again to you all!
Note: To whoever is planning to use P4python in maya. A great help is to get a list of all the p4 console commands by using “p4 help commands” in the command prompt. You can then use these commands in Maya with p4 .run() command.
Also, Jeremy Ernst show’s a good tutorial on the subject.