Python API 2.0 Reference
Main Page
Related Pages
Packages
Classes
Examples
python/api1/py1TorusFieldTest.py
1
#-
2
# ==========================================================================
3
# Copyright (C) 1995 - 2006 Autodesk, Inc. and/or its licensors. All
4
# rights reserved.
5
#
6
# The coded instructions, statements, computer programs, and/or related
7
# material (collectively the "Data") in these files contain unpublished
8
# information proprietary to Autodesk, Inc. ("Autodesk") and/or its
9
# licensors, which is protected by U.S. and Canadian federal copyright
10
# law and by international treaties.
11
#
12
# The Data is provided for use exclusively by You. You have the right
13
# to use, modify, and incorporate this Data into other products for
14
# purposes authorized by the Autodesk software license agreement,
15
# without fee.
16
#
17
# The copyright notices in the Software and this entire statement,
18
# including the above license grant, this restriction and the
19
# following disclaimer, must be included in all copies of the
20
# Software, in whole or in part, and all derivative works of
21
# the Software, unless such copies or derivative works are solely
22
# in the form of machine-executable object code generated by a
23
# source language processor.
24
#
25
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
26
# AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED
27
# WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF
28
# NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
29
# PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE, OR
30
# TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS LICENSORS
31
# BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL,
32
# DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK
33
# AND/OR ITS LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY
34
# OR PROBABILITY OF SUCH DAMAGES.
35
#
36
# ==========================================================================
37
#+
38
39
import
maya.cmds
as
cmds
40
41
def
torusField():
42
cmds.file(force=
True
, new=
True
)
43
cmds.currentUnit(linear=
"centimeter"
, angle=
"degree"
, time=
"film"
)
44
45
# Create the new field node
46
cmds.createNode(
"spTorusField"
, name=
"torus"
)
47
48
# create particle object.
49
#
50
cmds.particle(jbp=(0.0, 0.0, 0.0), nj=250, jr=5, c=1, name=
"particles"
)
51
52
# connect torus field node with the particle object.
53
#
54
cmds.connectDynamic(
"particles"
, f=
"torus"
)
55
cmds.setAttr(
"torus.attractDistance"
, 10)
56
cmds.setAttr(
"torus.repelDistance"
, 5)
57
58
cmds.playbackOptions(e=
True
, min=0.00, max=600.0)
59
cmds.currentTime(0, e=
True
)
60
cmds.play(wait=
True
, forward=
True
)
61
62
torusField()
Generated by
1.8.10