Python Reference Guide
 
Loading...
Searching...
No Matches
Samples\Geometry\ShapeCreation.py
1# Copyright 2009 Autodesk, Inc. All rights reserved.
2# Use of this software is subject to the terms of the Autodesk license agreement
3# provided at the time of installation or download, or which otherwise accompanies
4# this software in either electronic or hard copy form.
5#
6# Topic: FBModel.SetupPropertiesForShapes, FBGeometry, FBProperty.SetAnimated
7#
8
9
10from pyfbsdk import FBModel, FBModelPlane, FBGeometry, FBVertex, FBTime
11
12# Create the plane.
13lPlane = FBModelPlane('Deformable Plane')
14
15# The object must be set visible to be present in the system.
16lPlane.Visible = True
17lPlane.Show = True
18
19# Get the base geometry
20lGeometry = lPlane.Geometry
21
22# Begin modify geometry
23lGeometry.GeometryBegin()
24
25# Add shape
26lShape0Idx = lGeometry.ShapeAdd("Shape 0")
27
28# Init Shape
29lGeometry.ShapeInit(lShape0Idx, 2, False)
30
31# Set shape diff point
32lGeometry.ShapeSetDiffPoint(lShape0Idx, 0, 0, FBVertex(0.0, 100.0, 10.0, 0.0));
33lGeometry.ShapeSetDiffPoint(lShape0Idx, 1, 2, FBVertex(0.0, 100.0, 10.0, 0.0));
34
35# End modify geometry, notify for synchronization
36lGeometry.GeometryEnd()
37
38# Setup Properties for shapes explicity
39lPlane.SetupPropertiesForShapes()
40
41# Get Shape Property
42lShapeProp = lPlane.PropertyList.Find("Shape 0")
43lShapeProp.SetAnimated(True)
44
45# Get AnimationNode for insert key
46lAniNode = lShapeProp.GetAnimationNode()
47
48# Add Keys.
49lAniNode.KeyAdd(FBTime(0, 0, 0), 0.0)
50lAniNode.KeyAdd(FBTime(0, 0, 4), 100.0)
51lAniNode.KeyAdd(FBTime(0, 0, 8), 0.0)
52
53
54# Cleanup.
55del( lPlane, lGeometry, lShapeProp, lAniNode )
56del( FBModelPlane, FBGeometry, FBVertex, FBTime )
Plane model class.
Definition: pyfbsdk_generated.h:11944
Time data structure.
Definition: pyfbsdk_generated.h:19596