1
2
3
4
5
6
7
8
9
10
11
12from pyfbsdk import *
13
14
15lModels = FBModelList()
16
17
19
20
21
22lProperty = (('My Integer', FBPropertyType.kFBPT_int, 'Integer', True, True, None),
23 ('My Bool', FBPropertyType.kFBPT_bool, 'Bool', True, True, None),
24 ('My Float', FBPropertyType.kFBPT_float, 'Float', False, True, None),
25 ('My Double', FBPropertyType.kFBPT_double, 'Number',True, True, None),
26 ('My Chrptr', FBPropertyType.kFBPT_charptr, 'String', False, True, None),
27 ('My Enum', FBPropertyType.kFBPT_enum, 'Enum', True, True, None),
28 ('My Time', FBPropertyType.kFBPT_Time, 'Time', True, True, None),
29 ('My Obj', FBPropertyType.kFBPT_object, 'Object', False, True, None ),
30 ('My Stringlist', FBPropertyType.kFBPT_stringlist, 'StringList', False, True, None),
31 ('My Vector4D', FBPropertyType.kFBPT_Vector4D, 'Vector4', True, True, None),
32 ('My Vector3D', FBPropertyType.kFBPT_Vector3D, 'Vector', True, True, None),
33 ('My Vector2D', FBPropertyType.kFBPT_Vector2D, 'Vector2', True, True, None),
34 ('My Colour', FBPropertyType.kFBPT_ColorRGB, 'Color', True, True, None),
35 ('My ColourAndAlpha', FBPropertyType.kFBPT_ColorRGBA, 'ColorAndAlpha', True, True, None),
36 ('My Action', FBPropertyType.kFBPT_Action, 'Action', True, True, None),
37 ('My TimeSpan', FBPropertyType.kFBPT_TimeSpan, 'Time', False, True, None),
38 )
39
40
41
42
43
44
45
46
47
48
49
50
51if len( lModels ) == 0:
52 FBMessageBox(
"Message",
"Nothing selected",
"OK",
None,
None )
53
54else:
55
56
58 lFbp.Caption = "CREATING CUSTOM PROPERTIES"
59 lFbp.Text = "yay !"
60 lCount = 0.0
61
62
63 for x in lModels:
64
65 for ( pName, pType, pDataType,pAnimatable, pIsUser, pReferenceSource ) in lProperty:
66 prop = x.PropertyCreate( pName, pType, pDataType, pAnimatable, pIsUser, pReferenceSource )
67 if prop == None:
68 print(
"NoneObj:"+pName+
","+
str(pType))
69 else:
70 print(prop.GetName()+prop.GetPropertyTypeName())
71
72 lProp = x.PropertyList.Find('My Integer')
73 lProp.SetMin(-100)
74 lProp.SetMax(100)
75 lProp.Data = 10
76 lProp.SetAnimated(True)
77
78
79 lProp = x.PropertyList.Find('My Bool')
80 lProp.Data = False
81 lProp.SetAnimated(True)
82
83
84 lProp = x.PropertyList.Find('My Double')
85 lProp.SetMin(-100)
86 lProp.SetMax(100)
87 lProp.Data = 2.2
88
89 lProp.SetAnimated(True)
90
91
92 lProp= x.PropertyList.Find('My ChrPtr')
93 lProp.Data = "TestThis!"
94
95
96 lProp= x.PropertyList.Find('My Enum')
97 lEnumList = lProp.GetEnumStringList(True)
98 lEnumList.Add("Test1")
99 lEnumList.Add("Test2")
100 lEnumList.Add("Test3")
101 lProp.NotifyEnumStringListChanged()
102
103
104 lProp= x.PropertyList.Find('My Time')
105 lProp.Data =
FBTime(0,0,1,1)
106 lProp.SetAnimated =True
107
108
109 lProp = x.PropertyList.Find('My Vector3D')
110 lVector = FBVector3d(90,20,-70)
111 lProp.Data = lVector
112 lProp.SetAnimated(True)
113
114
115 lProp = x.PropertyList.Find('My Vector4D')
116 lVector = FBVector4d(90,20,-70,60)
117 lProp.Data = lVector
118 lProp.SetAnimated(True)
119
120
121 lProp = x.PropertyList.Find('My Colour')
123 lProp.Data = lColour
124 lProp.SetAnimated(True)
125
126
127 lProp = x.PropertyList.Find('My ColourAndAlpha')
129
130 lProp.SetAnimated(True)
131
132
133 lProp = x.PropertyList.Find('My Action')
134 lProp.SetAnimated(True)
135
136
137 lProp = x.PropertyList.Find('My Bool')
138 lProp.Data = True
139 lProp.SetAnimated(True)
140
141
142 lProp = x.PropertyList.Find('My Integer')
143 lProp.SetMin(0)
144 lProp.SetMax(100)
145 lProp.Data = 0
146 lProp.SetAnimated(True)
147
148 lCount += 1
149 lVal = lCount / len(lModels) * 100
150 lFbp.Percent =
int(lVal)
151
152
153 lFbp.FBDelete()
154
155
156
157
158
159
160
161
162
Color and alpha vector.
Definition: pyfbsdk_generated.h:4497
Color vector.
Definition: pyfbsdk_generated.h:4470
Progress bar.b>Property: Base property class.
Definition: pyfbsdk_generated.h:14666
Time data structure.
Definition: pyfbsdk_generated.h:19596
Python built-in int class.
Definition: pyfbsdk.h:59
Python built-in string class.
Definition: pyfbsdk.h:77
FBGetSelectedModels(FBModelList pList, FBModel pParent=None, bool pSelected=True, bool pSortBySelectOrder=False)
Find all models that are selected (if pSelected is true) Searches recursively from a root model for m...
int FBMessageBox(str pBoxTitle, str pMessage, str pButton1Str, str pButton2Str=None, str pButton3Str=None, int pDefaultButton=0, int pScrolledMessage=0)
Dialog popup box.