The Area http://area.autodesk.com/forum/ The Area en Copyright 2009 2009-11-22T10:27:05+01:00 Hide Selection instead of visibility off http://area.autodesk.com/forum/autodesk-motionbuilder/python/hide-selection-instead-of-visibility-off/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/hide-selection-instead-of-visibility-off/page-last/#When:10:09:14Z Hi guys, I searched for this topic in the mb python help but I didn't get any useable results. That's why I like to ask you. ;) My thing is not really a problem: I'd like to hide some models via python by selecting them and using "Hide Selection" from the context menu, instead of turning off the visibility in the models properties. I already did the last option and it worked out well but how does it work with the "Hide Selection" command? Is it somehow accesable with python? The difference is that you have a visible feedback in the schematic view in contrary to the visibility property. Thx for your help. Chris 2009-11-20T10:09:14+01:00 Snap and play on frames http://area.autodesk.com/forum/autodesk-motionbuilder/python/snap-and-play-on-frames/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/snap-and-play-on-frames/page-last/#When:23:04:56Z Hey all, I am trying to force the playback to 'Snap and Play on Frames' but I cant get it to work. This executes without errors, but doesn't do anything. [code] from pyfbsdk import * FBTransportSnapMode.kFBTransportSnapModeSnapAndPlayOnFrames[/code] Am I missing something here? I have had to much cold medication, so thats my excuse... 2009-11-17T23:04:56+01:00 Setting keys from matrix using FBPlayerControls Key() http://area.autodesk.com/forum/autodesk-motionbuilder/python/setting-keys-from-matrix-using-fbplayercontrols-key4041/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/setting-keys-from-matrix-using-fbplayercontrols-key4041/page-last/#When:23:02:54Z Hi, I've run into something I can't seem to get to work. What I've got is loads of matrix data which I'd like to set on an object and set keyframes. I've looked into using FBPlayerControls Key() member, but it only seems to work on node.Translation or node.Rotation. What I'd like to see work is setting the node.Matrix attribute the same way I do the position or rotation. So I'm wondering if this is possible. If not, I'd have to choose another solution obviously. In that case my question is; How do I set keyframes from a matrix? Any help greatly appreciated! BR mrK 2009-11-17T23:02:54+01:00 MoBu Console Window http://area.autodesk.com/forum/autodesk-motionbuilder/python/mobu-console-window/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/mobu-console-window/page-last/#When:15:53:37Z So I've been messing around with the command line flags "-console -verbosePython" to enable debug spew for some python scripts. Is there something in my scripts that I need to do (such as scene eval) to make the console window update every time I print something to it? Depending on the scripted task, the output window seems to either update periodically, in one huge dump, or sometimes not even at all. I've also noticed that the console window does not appear to display any output messages until the python editor has been opened once. Does anyone have any advice on best practices or tips to getting a better real-time performance out of the console window? Thanks -csa 2009-11-17T15:53:37+01:00 ImportError: cannot import name FBAnimationAction http://area.autodesk.com/forum/autodesk-motionbuilder/python/importerror-cannot-import-name-fbanimationaction/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/importerror-cannot-import-name-fbanimationaction/page-last/#When:15:52:48Z Any help with this? I have a retarget script from 2009 that calls this, but I am getting an error in Mobu 2010. Did this command get renamed in 2010? Thanks. -G 2009-11-17T15:52:48+01:00 Render Compression Settings http://area.autodesk.com/forum/autodesk-motionbuilder/python/render-compression-settings/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/render-compression-settings/page-last/#When:12:17:19Z Hi there, I am trying to make a script to render files to specific render settings and compression settings. I have got all the render settings sorted and working fine. As I go to set the Compression settings it doesnt seem to work. I tell the script to print the default codec, in which is prints 'png' which is the type i wish to use. But when i go to set this it doesn't seem to change a thing and still has 'Video' as the selected compression type. What am I doing wrong? mgr = FBVideoCodecManager() mgr.VideoCodecMode = FBVideoCodecMode.FBVideoCodecStored mgr.GetDefaultCodec("mov") print "Default Compression file is " + mgr.GetDefaultCodec("mov") ##This returns: "Default Compression file is png"## mgr.SetDefaultCodec("mov", "png") 2009-11-17T12:17:19+01:00 Merge Callback not working in 2010? http://area.autodesk.com/forum/autodesk-motionbuilder/python/merge-callback-not-working-in-2010/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/merge-callback-not-working-in-2010/page-last/#When:22:08:08Z I was wonderng if anyone can confirm whether or not FBApplication().OnFileMerge is actually triggering any callback requests. I've been successful with a bunch of other callbacks, but OnFileMerge appears to not be getting triggered for me. Can someone else help me take a look at this? This code for OnFileNew works. To test, load the code, then do a file, new. You get the debug printout like you'd expect [code] import pyfbsdk as fb def newCallback( obj, evt ): print "[newCallback] obj: %s, evt: %s" % (obj.Name, evt.Type) app = fb.FBApplication() eFileNew = app.OnFileNew eFileNew.Add(newCallback) [/code] This code for OnFileMerge does nothing, and is almost the exact same code you need to trigger it (unless I'm missing something here): [code] import pyfbsdk as fb def mergeCallback( obj, evt ): print "[mergeCallback] obj: %s, evt: %s" % (obj.Name, evt.Type) app = fb.FBApplication() eFileMerge = app.OnFileMerge eFileMerge.Add(mergeCallback) [/code] Is there something special about OnFileMerge that I need to do in order to properly trigger it? Doing a merge from the main file menu does nothing. -csa 2009-11-13T22:08:08+01:00 Loading Proprietary Python Modules http://area.autodesk.com/forum/autodesk-motionbuilder/python/loading-proprietary-python-modules/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/loading-proprietary-python-modules/page-last/#When:02:01:01Z Hi all, I posted this a while ago but it posted it rather vaguely so i figured i put a slightly more descriptive question: I am having issues trying to load some of our proprietary modules inside motion Builder. I have found several places that work but none consistantly. There is a python startup folder path that i have set, that doesnt seem to do anything, and there is a USER.Python.txt that saves the last opened filepath inside the python editor. So far only editing the txt file will allow me access to the modules, the downside to doing that is as soon as i open a new file that is outside that path it changes the "Last Path" string inside the txt file. I would think that the path inside preferences should be the correct way to do this but i have been unlucky so far. Is there something i am missing? 2009-11-13T02:01:01+01:00 fork and exec in MB? http://area.autodesk.com/forum/autodesk-motionbuilder/python/fork-and-exec-in-mb/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/fork-and-exec-in-mb/page-last/#When:22:29:43Z So I've got a script that does random MotionBuilder stuff, and the last thing it should do is run a windows program. I've noticed that if I use os.system() MB hangs and there's no os.fork(). Basically, I just want to fire off an .exe program and still have control in MB. Anyone have any experience with this? Thanks! 2009-11-12T22:29:43+01:00 Working with Subtracks in the Story http://area.autodesk.com/forum/autodesk-motionbuilder/python/working-with-subtracks-in-the-story/page-last/ http://area.autodesk.com/forum/autodesk-motionbuilder/python/working-with-subtracks-in-the-story/page-last/#When:07:53:11Z Hi all, I wonder if (and how) it is possible to use subtracks with Python ? I manage to create a subtrack by using this : [color=orange]lSubTrack = FBStoryTrack(FBStoryTrackType.kFBStoryTrackAnimation) lMainTrack.SubTracks.append(lSubTrack)[/color] (It's certainly not the best way since it first creates a standard track, then add an instance of it as subtrack for my "Maintrack".) After that, I can set some properties for the subtrack : [color=orange]lSubTrack.PassThrough = False lSubTrack.AcceptKey = True[/color] But it's getting more complicated when I want to : - Set my subtrack to "Additive" ? - Plant a key for each items it contains ? - Plot Help ! Thanks. 2009-11-09T07:53:11+01:00