BuildPath() and os.path.join() should be the same.
Just shooting in the dark here, but try wrapping your value with
os.path.normpath() before importing the model.
Last but not least, the obvious... does the file truly exist? You can check
with:
if os.path.exists(mdlPath): lm("File exists!")
else: lm("Uh oh, file not found! :(")
On Wed, Jun 5, 2013 at 5:04 PM, Andy Moorer <[email protected]> wrote:
> Ah damn I was hoping it was going to be something glaringly obvious and
> that people would mock me. :D
>
> I'll look at BuildPath, thanks for the suggestion Eric.
>
> Here's the error:
> _____________
>
> Application.ImportModel("", "", "", "", "", "", "")
> # ERROR : Traceback (most recent call last):
> # File "<Script Block >", line 15, in <module>
> # xsi.ImportModel(mdlPath) #Errors out
> # File "<COMObject Application>", line 2, in ImportModel
> # COM Error: The parameter is incorrect. (0x-7ff8ffa9) - [line 15]
>
>
>
> On Wed, Jun 5, 2013 at 1:51 PM, Eric Thivierge <[email protected]>wrote:
>
>> Error message would help but maybe the slash formatting isn't something
>> SI is liking?
>>
>> Maybe using XSIUtils.BuildPath() would work better?
>>
>> Eric Thivierge
>> ===============
>> Character TD / RnD
>> Hybride Technologies
>>
>>
>> On 05/06/2013 4:47 PM, Andy Moorer wrote:
>>
>>> Ok, I'm wearing my dunce cap. I am trying to import a model which
>>> resides in a workgroup's "models" folder.
>>>
>>> I have an environment variable set which is the path to the workgroup.
>>>
>>> I'm obviously missing something simple. Any suggestions?
>>>
>>> ____________
>>>
>>> xsi = Application
>>> lm = xsi.LogMessage
>>> import os
>>>
>>> SOFTIMAGE_WG = os.environ['SOFTIMAGE_WG']
>>>
>>> WGpath = os.path.join(SOFTIMAGE_WG, "Models")
>>>
>>> lm (WGpath) #Path logged is correct
>>>
>>> mdlPath= os.path.join(WGpath, "TapeMeasure.emdl")
>>>
>>> lm (mdlPath) #yes, still correct... mdlPath is type string
>>>
>>> xsi.ImportModel(mdlPath) #Errors out
>>>
>>
>>
>>
>