Jump to content

danielsweeney

Members
  • Content count

    4
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Community Reputation

0 Neutral

About danielsweeney

  • Rank
    Peon

Personal Information

  • Name
    daniel sweeney
  • Location
    leeds
  1. Hi people. Just wondering if anyone is having this same problem. I am fairly new to python and I am following along with Mix training video on youtube about python panels. https://www.youtube.com/watch?v=jL7jM1bJhxE&list=PLAnSvhIvNZCs4_D1JYZitBEBmf31_2ylL&index=1 and for some reason, I am stumbling at the first hurdle. When trying to import the OS module for python in the python panel window. its does not seem to work. Now if I go in and 'import os' via the python shell it works. Can anyone shed some light on this? or has anyone had this issue before? on 17.5 cheers Daniel
  2. hou.hipFile.save problems - need help

    I am only asking as when reloading the scene. Either the variable is not there anymore or it does not reflect the information that is sitting in the HDA. So I need a way for that Data to stay within the HIP file so when it is re opened the Global data for that file in still available. Any ideas?
  3. hou.hipFile.save problems - need help

    Hi Stalker. Thanks for the reply. much appreciated I Took your advice on using the os.path.join. Works well and of course is the correct way to do it. But I was still getting the problem though. Found out it was down to creating the whole path that was the problem for some reason. So I broke up creating the work category and the whole file path. like #create work catagory folder if os.path.exists(exWorkCatagPath) == False: os.mkdir(exWorkCatagPath) else: printMe = "no Directory created!!" print printMe # save full file hou.hipFile.save(exSavePath, False) But I do have another question. As I am creating the variables for this like below. hou.putenv("FOLDERNAME", fname) It is storing this in an environment variable I believe. Which I think might not be the best option. Is their anyway I can store these variables in the HIP file so I can pull them into other areas like ROPS for instance via $FOLDERNAME. a Local variable that is only available in the hip file that has been saved. Thanks for your help again. Daniel
  4. hou.hipFile.save problems - need help

    Hi Everyone, Hope you are all well. We have not been using houdini long. We are long time soft users and we are testing out software to move too and see the strengths of them. Houdini is our first choice for the sheer scope of it, so we have started looking at this first. Anyways, explaination of the problem below. I am trying to script a "simple" saving function through a HDA via Python (I dont know if this is a correct way of doing it, so please If I am going in the wrong direction, shout) it will create a few folders based on some parameters in the HDA interface and save the file with the name specified. I am setting environment variables through this and using that to generate the path for the file save and also will hopefully re-use the Environment variables later for ROP output ETC for the scene. I am running into an error with what I believe is to do with the hou.hipFile.save function. I have not been coding for very long either so please bare with me if my Termanology is off also. I have attached some code snippets. I am basically trying to save the files to a structured job folder system. something like below. $JOB/scene/[WORKCATAGORY]/[SHOTFOLDER]/SHOTNAME.hipnc I have defined some functions in the Python Module in the HDA, and these are being called by the callback script on each parameter. It is really weird, It has worked once or twice. But then I try to save again and it does not work again. I did some debugging and the Error that houdini generates, it definately works when I take out the SHOTFOLDER in the string for the path to save to. If my file path is just saved in the WORKCATAGORY section it saves. My defined functions (sorry code is messy) def shotName(parm): hou.putenv("SHOTNAME", parm) test = parm print test def folderName(parm): fname = "NN_" + parm hou.putenv("FOLDERNAME", fname) test = fname print test def workCatagory(node, parm): a = hou.parm(parm.path()).eval() labelName = hou.parm(parm.path()).menuLabels()[a] testA = parm hou.putenv("WORKCATAGORY", labelName) print labelName def customSave(): #Pull in Enviroment Variables work = hou.getenv("WORKCATAGORY") shot = hou.getenv("SHOTNAME") folder = hou.getenv("FOLDERNAME") # Houdini save path FULL savePath = "$JOB/scene/" + work + "/" + folder + "/" + shot + ".hipnc" # Houdini save path with a job catagory but not job name folder #savePath = "$JOB/scene/" + work + "/" + shot + ".hipnc" exSavePath = hou.expandString(savePath) exSavePath = exSavePath.replace('//', '/') #hou.putenv("SAVEPATH", exSavePath ) hou.hipFile.save(exSavePath, False) print exSavePath the error it generates is Traceback (most recent call last): File "<stdin>", line 1, in <module> File "opdef:/Object/Northforge3_testa?PythonModule", line 40, in customSave File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.600/houdini/python2.7libs\houpythonportion.py", line 1287, in decorator return func(*args, **kwargs) File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.600/houdini/python2.7libs\hou.py", line 28330, in save return _hou.hipFile_save(*args, **kwargs) OperationFailed: The attempted operation failed. Error creating file: W:/Work/Development/D00026_Houdini_test/3.3d/D00026_Houdini_test_HOUDINI/scene/rend/NN_test/test.hipnc working enviroment is. Windows 10 Houdini Apprentice 16.0 saving to a NAS drive I hope some of that makes sense. Cheers
×