Commits

Anonymous committed 067f940

Fix object selection when baking ipo

Comments (0)

Files changed (1)

blenderExporter/osg/osgdata.py

 def findObjectForIpo(ipo):
     index = ipo.name.rfind('-')
     if index != -1:
-        objname = ipo.name[index:]
+        objname = ipo.name[index+1:]
         try:
             obj = bpy.data.objects[objname]
             log("bake ipo %s to object %s" % (ipo.name, objname))
 
     dummy_object = None
     if obj is None:
-        log('WARNING Bake ipo without object, it means that it will not be possible to bake constraint, use an iponame that contains the object associated to him, like myipo-MyObject')
+        log('WARNING Bake ipo %s without object, it means that it will not be possible to bake constraint, use an name ipo that contains the object associated to him, like myipo-MyObject' % ori_ipo.name)
         obj = bpy.data.scenes.active.objects.new('Empty')
         dummy_object = obj
 
         obj.setIpo(previous_ipo)
 
     if dummy_object:
-        bpy.data.objects.unlink(dummy_object)
+        bpy.data.scenes.active.objects.unlink(dummy_object)
         
     return baked
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.