Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX Plug-ins Import-Export Discussions / Unable to Export Array (#stringTab) Custom Attributes from Max + Freeze
  RSS 2.0 ATOM  

Unable to Export Array (#stringTab) Custom Attributes from Max + Freeze
Rate this thread
 
35899
 
Permlink of this thread   Subscribe to this thread
avatar
  • TomasV
  • Posted: 23 October 2009 01:29 AM
  • Total Posts: 3
  • Joined: 23 October 2009 06:28 AM

I hope I’m not doing anything wrong, but I can’t export any Array (#stringTab) custom attribute. I’m running 3DS Max 2009 64-bit SP1 with Creativity Extension.

This is the code I’m using for that (attached CA_stringTab.ms + fbx):

obj Teapot()

caDef 
attributes Custom_Attributes
(
  parameters main rollout
:params 
  (
    pStringTab type
:#stringTab tabSizeVariable:true 
  

  rollout params 
"Custom Attributes"
  
(
    listbox l1 
"Param1"
    
      
on params open do
      
(
        l1
.items this.pStringTab as Array
      
)
  )
)

custAttributes
.add obj caDef
obj
.pStringTab #("x", "y", "z")
select obj
max modify mode

The ‘#stringTab’ parameter can’t be automatically linked to the listbox, so I’m using a simple event handler to populate the listbox (this could be more elaborate).

When I export the resulting object with FBX 2010.2 (ASCII), I can find the line where the custom parameter ‘#stringTab’ should be, but it contains only the first element of the array:

Property"Teapot01.Custom_Attributes.pStringTab""KString""U""x"

Using the built-in Parameter Editor I tried to create a custom attribute array and I was able to successfully export it. Looking at the code used in there via custAttributes.getDefSource and slightly modifying it, I made the following example (attached CA_array_bug.ms + fbx):

obj Teapot()

caDef 
attributes Custom_Attributes
(
  parameters main rollout
:params 
  (
    pInt type
:#integer
  

  rollout params 
"Custom Attributes"
  
(
    listbox l1 
"Param1" items:#("x", "y", "z")
  
)
)

custAttributes
.add obj caDef
obj
.pInt 2
select obj
max modify mode

This is where it gets interesting - the ‘pInt’ parameter isn’t linked in any way with the listbox ‘l1’, yet the resulting FBX file lists the ‘pInt’ parameter as an array (or ‘Enum’, even though it should actually be an integer). It also imports as an array back into Max or Maya:

Property"Teapot01.Custom_Attributes.pInt""Enum""A+U",1"x~y~z"

So I thought I could add a ‘#stringTab’ parameter, work with that according to my needs, and it would be then copied to and exported via the UI listbox. But the following code makes Max always freeze while exporting the result to FBX (attached CA_sure_freeze.ms):

obj Teapot()

caDef 
attributes Custom_Attributes
(
  parameters main rollout
:params 
  (
    pInt type
:#integer
    
pStringTab type:#stringTab tabSizeVariable:true 
  

  rollout params 
"Custom Attributes"
  
(
    listbox l1 
"Param1"
    
      
on params open do
      
(
        l1
.items this.pStringTab as Array
      
)
  )
)

custAttributes
.add obj caDef
obj
.pStringTab #("x", "y", "z")
select obj
max modify mode

Is there any way to export an array custom attribute? I’d like to avoid converting arrays to strings and back, else I could have stayed with User Defined Properties…

According to this old document, Custom Attributes - Array should have “Perfect compatibility” between applications:

http://docs.google.com/gview?a=v...HL6MnfiFKPZ_Wed0Zq2Fr_3nA

Thanks in advance.



Replies: 0
avatar
  • TomasV
  • Posted: 23 October 2009 01:34 AM

I can’t seem to be able to add attachments, but I’ll be happy to email them if someone is interested. All the code that is needed is in the previous post anyway.



Replies: 0




   
  Settings Choose Theme color: