Keresés

Új hozzászólás Aktív témák

  • Whysperer

    addikt

    válasz sztanozs #2377 üzenetére

    Példának okáért ilyenek.

    [link]

    fogtam begépeltem amit csinált. beadta a random kockákat . és majd abból gyorsan tudtam csinálni egy szimulációt ahogy a kockák fújja a levegőben a szél és pörögnek a levegőben.

    Szóval így használni tudom mayaban csak érteni is szeretném.

    másodiknál már a szél tartja a levegőben őket randomra és pörgeti. Szóval ilyenekre lenne jó.

    # randomCubes.py

    import maya.cmds as cmds
    import random

    random.seed( 1234 )

    '''
    cubeList = cmds.ls( 'myCube*' )
    if len( cubeList ) > 0:
    cmds.delete( cubeList )
    '''

    result = cmds.polyCube( w=1, h=1, d=1, name='myCube#' )

    #print 'result: ' + str( result )

    transformName = result[0]

    instanceGroupName = cmds.group( empty=True, name=transformName + '_instance_grp#' )

    for i in range( 0, 50 ):

    instanceResult = cmds.instance( transformName, name=transformName + '_instance#' )

    cmds.parent( instanceResult, instanceGroupName )

    #print 'instanceResult: ' + str( instanceResult )

    x = random.uniform( -10, 10 )
    y = random.uniform( 0, 20 )
    z = random.uniform( -10, 10 )

    cmds.move( x, y, z, instanceResult )

    xRot = random.uniform( 0, 360 )
    yRot = random.uniform( 0, 360 )
    zRot = random.uniform( 0, 360 )

    cmds.rotate( xRot, yRot, zRot, instanceResult )

    scalingFactor = random.uniform( 0.3, 1.5 )

    cmds.scale( scalingFactor, scalingFactor, scalingFactor, instanceResult )

    cmds.hide( transformName )

    cmds.xform( instanceGroupName, centerPivots=True )

    ASUS b550 a gaming/ Ryzen 5800x3d/arctic liquid freezer ii 280/EVGA 550w GS/ SSD240+120Gb/g skill aegis 32 gb 3200 mhz / RX6800/Regnum RG6V TG

Új hozzászólás Aktív témák