Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendon Murphy <meta.androcto1@gmail.com>2015-05-20 21:26:32 +0300
committerBrendon Murphy <meta.androcto1@gmail.com>2015-05-20 21:26:32 +0300
commit189552a857956f30bf3bed28e98b1a087f47f86f (patch)
tree75a2a2ff6070a0434f90c000dd327a7acea44814
parent87e95103c5165634eead5e6a2cdb7c68079f26db (diff)
fix for broken Paths, Thanks pildanovak
-rw-r--r--object_fracture/fracture_ops.py51
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):