<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get namespace from selected model but not a namespace list. in MotionBuilder Forum</title>
    <link>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10010145#M854</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10196790"&gt;@爱贝贝&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I want to get namespace from selected bone with MoBu python. However this codes get a namespace list . from pyfbsdk import * selected_models = FBModelList() FBGetSelectedModels(selected_models) i = selected_models NS = FBStringList() Count = FBSystem().Scene.NamespaceGetChildrenList(NS) x = i for x in NS: localNS = FBSystem().Scene.NamespaceGet(x) print x How can i do this with MoBu python?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Do you mean somehthing like this? It will only return the first object in a list - so the first model you select (even if you select multiple models by accident).&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pyfbsdk import *

def GetSelModelNameSpace():
    lSelModels = []
    modelList = FBModelList()
    FBGetSelectedModels (modelList, None, True)
    for model in modelList:
        if model.Selected == True:
           lSelModels.extend( [ model.LongName.rsplit(':', 1)[0] ] )
    return lSelModels[0]
        

        
myNameSpace = GetSelModelNameSpace()
print myNameSpace&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jan 2021 16:02:09 GMT</pubDate>
    <dc:creator>vdebaie</dc:creator>
    <dc:date>2021-01-18T16:02:09Z</dc:date>
    <item>
      <title>Get namespace from selected model but not a namespace list.</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10007215#M853</link>
      <description>I want to get namespace from selected bone with MoBu python. However this codes get a namespace list . from pyfbsdk import * selected_models = FBModelList() FBGetSelectedModels(selected_models) i = selected_models NS = FBStringList() Count = FBSystem().Scene.NamespaceGetChildrenList(NS) x = i for x in NS: localNS = FBSystem().Scene.NamespaceGet(x) print x How can i do this with MoBu python?</description>
      <pubDate>Sun, 17 Jan 2021 05:28:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10007215#M853</guid>
      <dc:creator>爱贝贝</dc:creator>
      <dc:date>2021-01-17T05:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get namespace from selected model but not a namespace list.</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10010145#M854</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10196790"&gt;@爱贝贝&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I want to get namespace from selected bone with MoBu python. However this codes get a namespace list . from pyfbsdk import * selected_models = FBModelList() FBGetSelectedModels(selected_models) i = selected_models NS = FBStringList() Count = FBSystem().Scene.NamespaceGetChildrenList(NS) x = i for x in NS: localNS = FBSystem().Scene.NamespaceGet(x) print x How can i do this with MoBu python?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Do you mean somehthing like this? It will only return the first object in a list - so the first model you select (even if you select multiple models by accident).&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pyfbsdk import *

def GetSelModelNameSpace():
    lSelModels = []
    modelList = FBModelList()
    FBGetSelectedModels (modelList, None, True)
    for model in modelList:
        if model.Selected == True:
           lSelModels.extend( [ model.LongName.rsplit(':', 1)[0] ] )
    return lSelModels[0]
        

        
myNameSpace = GetSelModelNameSpace()
print myNameSpace&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 16:02:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10010145#M854</guid>
      <dc:creator>vdebaie</dc:creator>
      <dc:date>2021-01-18T16:02:09Z</dc:date>
    </item>
    <item>
      <title>回复： Get namespace from selected model but not a namespace list.</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10011411#M855</link>
      <description>&lt;P&gt;Your answer really helped me,thank you very much!!&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 02:24:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10011411#M855</guid>
      <dc:creator>爱贝贝</dc:creator>
      <dc:date>2021-01-19T02:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get namespace from selected model but not a namespace list.</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10014822#M856</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="爱贝贝_0-1611110418223.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/868847iD269935B76E03E60/image-size/medium?v=v2&amp;amp;px=400" role="button" title="爱贝贝_0-1611110418223.png" alt="爱贝贝_0-1611110418223.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;One more question ,as you can see from this screenshot ,number 1 is what i want ,but&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;I don't know what caused number 2. To be honest ,i use MoBu python only a few days, i still have a lot of things to learn .Thanks again.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 03:05:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10014822#M856</guid>
      <dc:creator>爱贝贝</dc:creator>
      <dc:date>2021-01-20T03:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get namespace from selected model but not a namespace list.</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10016149#M857</link>
      <description>&lt;P&gt;I blieve what you want is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print rh.LongName&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 14:15:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10016149#M857</guid>
      <dc:creator>vdebaie</dc:creator>
      <dc:date>2021-01-20T14:15:47Z</dc:date>
    </item>
    <item>
      <title>回复： Get namespace from selected model but not a namespace list.</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10018380#M858</link>
      <description>&lt;P&gt;I want to set it to T-Pose by (this is part of the complete codes),because i have many characters to set up , and they always change&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;rh = FBFindModelByLabelName( myNameSpace + ":Hips" )
rh.Selected = True
rh.Selected = False
rh.Rotation = FBVector3d(90,0,0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;but not by&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;rh = FBFindModelByLabelName( 'wuchen:Hips' )
rh.Selected = True
rh.Selected = False
rh.Rotation = FBVector3d(90,0,0)&lt;/LI-CODE&gt;&lt;P&gt;'print rh.LongName' truely get wuchen:Hips ,but it does not work with my T-Pose code.I really want to&amp;nbsp;solve it.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 06:26:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/get-namespace-from-selected-model-but-not-a-namespace-list/m-p/10018380#M858</guid>
      <dc:creator>爱贝贝</dc:creator>
      <dc:date>2021-01-21T06:26:51Z</dc:date>
    </item>
  </channel>
</rss>

