diff options
author | Brendon Murphy <meta.androcto1@gmail.com> | 2015-05-20 21:26:32 +0300 |
---|---|---|
committer | Brendon Murphy <meta.androcto1@gmail.com> | 2015-05-20 21:26:32 +0300 |
commit | 189552a857956f30bf3bed28e98b1a087f47f86f (patch) | |
tree | 75a2a2ff6070a0434f90c000dd327a7acea44814 /object_fracture | |
parent | 87e95103c5165634eead5e6a2cdb7c68079f26db (diff) |
fix for broken Paths, Thanks pildanovak
Diffstat (limited to 'object_fracture')
-rw-r--r-- | object_fracture/fracture_ops.py | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py index 74558dad..69ec3202 100644 --- a/object_fracture/fracture_ops.py +++ b/object_fracture/fracture_ops.py @@ -437,27 +437,36 @@ class FractureGroup(bpy.types.Operator): # Import Functions def import_object(obname): - opath = "//data.blend\\Object\\" + obname - s = os.sep - dpath = bpy.utils.script_paths()[0] + \ - '%saddons%sobject_fracture%sdata.blend\\Object\\' % (s, s, s) - - # DEBUG - #print('import_object: ' + opath) - - bpy.ops.wm.link_append( - filepath=opath, - filename=obname, - directory=dpath, - filemode=1, - link=False, - autoselect=True, - active_layer=True, - instance_groups=True, - relative_path=True) - - for ob in bpy.context.selected_objects: - ob.location = bpy.context.scene.cursor_location + opath = "//data.blend\\Object\\" + obname + s = os.sep + #dpath = bpy.utils.script_paths()[0] + \ + # '%saddons%sobject_fracture%sdata.blend\\Object\\' % (s, s, s) + dpath='' + fpath='' + for p in bpy.utils.script_paths(): + + testfname= p + '%saddons%sobject_fracture%sdata.blend' % (s,s,s) + print(testfname) + if os.path.isfile(testfname): + fname=testfname + dpath = p + \ + '%saddons%sobject_fracture%sdata.blend\\Object\\' % (s, s, s) + break + # DEBUG + #print('import_object: ' + opath) + + bpy.ops.wm.append( + filepath=opath, + filename=obname, + directory=dpath, + filemode=1, + link=False, + autoselect=True, + active_layer=True, + instance_groups=True) + + for ob in bpy.context.selected_objects: + ob.location = bpy.context.scene.cursor_location class ImportFractureRecorder(bpy.types.Operator): |