<?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 [Python][SDK] Create Property not working? in FBX Forum</title>
    <link>https://forums.autodesk.com/t5/fbx-forum/python-sdk-create-property-not-working/m-p/9332213#M918</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to use the 2019.0 python sdk to read and write a property to the scene of an fbx file. However, after much digging and testing, I am fearing the worst, that it may not be implemented correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is by no means final code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;def set_data_to_file(file_name, data):
    """Get data from scene.
    Usage:
    set_data_to_file(r"C:\temp\no_data.fbx", "{'data':1}")
    """
    lSdkManager, lScene = FbxCommon.InitializeSdkObjects()
    lResult = FbxCommon.LoadScene(lSdkManager, lScene, file_name)

    if not lResult:
        print("An error occurred while loading the scene...")
    else:
        p1 = lScene.FindProperty('MyCustomProp')
        if p1.IsValid() == False:
			p1 = FbxCommon.FbxProperty.Create(lScene, FbxCommon.FbxPropertyString, str('MyCustomProp'))
			FbxCommon.SaveScene(lSdkManager, lScene, file_name, pFileFormat=0)
			
    lSdkManager.Destroy()
    &lt;/PRE&gt;&lt;P&gt;However I am seemingly running into an error on the Create call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;TypeError: arguments did not match any overloaded call:
  FbxProperty.Create(FbxProperty, FbxDataType, str, str pLabel="", bool pCheckForDup=True): argument 1 has unexpected type 'FbxScene'
  FbxProperty.Create(FbxObject, FbxDataType, str, str pLabel="", bool pCheckForDup=True): argument 2 has unexpected type 'sip.wrappertype'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if I attempt to create a property on a regular scene node i get this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;TypeError: arguments did not match any overloaded call:
  FbxProperty.Create(FbxProperty, FbxDataType, str, str pLabel="", bool pCheckForDup=True): argument 1 has unexpected type 'FbxNode'
  FbxProperty.Create(FbxObject, FbxDataType, str, str pLabel="", bool pCheckForDup=True): argument 2 has unexpected type 'sip.wrappertype'&lt;/PRE&gt;&lt;P&gt;Am I implementing correctly? Can anyone confirm if this is working or not? If not, any ideas on a work around?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2020 22:36:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-20T22:36:12Z</dc:date>
    <item>
      <title>[Python][SDK] Create Property not working?</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/python-sdk-create-property-not-working/m-p/9332213#M918</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to use the 2019.0 python sdk to read and write a property to the scene of an fbx file. However, after much digging and testing, I am fearing the worst, that it may not be implemented correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is by no means final code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;def set_data_to_file(file_name, data):
    """Get data from scene.
    Usage:
    set_data_to_file(r"C:\temp\no_data.fbx", "{'data':1}")
    """
    lSdkManager, lScene = FbxCommon.InitializeSdkObjects()
    lResult = FbxCommon.LoadScene(lSdkManager, lScene, file_name)

    if not lResult:
        print("An error occurred while loading the scene...")
    else:
        p1 = lScene.FindProperty('MyCustomProp')
        if p1.IsValid() == False:
			p1 = FbxCommon.FbxProperty.Create(lScene, FbxCommon.FbxPropertyString, str('MyCustomProp'))
			FbxCommon.SaveScene(lSdkManager, lScene, file_name, pFileFormat=0)
			
    lSdkManager.Destroy()
    &lt;/PRE&gt;&lt;P&gt;However I am seemingly running into an error on the Create call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;TypeError: arguments did not match any overloaded call:
  FbxProperty.Create(FbxProperty, FbxDataType, str, str pLabel="", bool pCheckForDup=True): argument 1 has unexpected type 'FbxScene'
  FbxProperty.Create(FbxObject, FbxDataType, str, str pLabel="", bool pCheckForDup=True): argument 2 has unexpected type 'sip.wrappertype'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if I attempt to create a property on a regular scene node i get this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;TypeError: arguments did not match any overloaded call:
  FbxProperty.Create(FbxProperty, FbxDataType, str, str pLabel="", bool pCheckForDup=True): argument 1 has unexpected type 'FbxNode'
  FbxProperty.Create(FbxObject, FbxDataType, str, str pLabel="", bool pCheckForDup=True): argument 2 has unexpected type 'sip.wrappertype'&lt;/PRE&gt;&lt;P&gt;Am I implementing correctly? Can anyone confirm if this is working or not? If not, any ideas on a work around?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 22:36:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/python-sdk-create-property-not-working/m-p/9332213#M918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-20T22:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: [Python][SDK] Create Property not working?</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/python-sdk-create-property-not-working/m-p/9334478#M919</link>
      <description>&lt;P&gt;Ok, I found something that works, so this is for anyone who finds this in 5 years time.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;p1 = FbxCommon.FbxProperty.Create(lScene, (fbx.FbxDataType()).Create(str('eFbxString'), 18), str('MyCustomProp'))&lt;/PRE&gt;&lt;P&gt;This was another lovely journey of 'guess the syntax' in Autodesk python sdk's.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 21:20:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/python-sdk-create-property-not-working/m-p/9334478#M919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-21T21:20:02Z</dc:date>
    </item>
  </channel>
</rss>

