From: Rajagopalan, S. <SRa...@tm...> - 2011-05-04 18:26:32
|
Hi Everyone, I am making a movie and want to show the transition between a cartoon and a ribbon representation smoothly (fading out cartoon and fading in ribbon) . So I tried writing a simple python script like: ------- for i in range(40,60): cmd.mdo (i, "set cartoon_transparency,%f" %( 1-(60-i)/60.0 ); "set ribbon_transparency,%f" %( (60-i)/60.0 ) ) ------- And ------- for i in range(40,60): cmd.mdo (i, "set cartoon_transparency,%f" %( 1-(60-i)/60.0 ) ) for j in range (40,60): cmd.mdo (j, "set ribbon_transparency,%f" %( (60-j)/60.0 ) ) ------ And various other combinations, but none seem to produce the result that I desire. Can anyone help me with the scripting as my python knowledge is very basic. Thanks Sena PS Sorry my half-typed email got accidentally sent earlier Methodist. Leading Medicine. Recognized by U.S.News & World Report as one of America's "Best Hospitals" in 13 specialties. Named to FORTUNE magazine's "100 Best Companies to Work For" list five years in a row Designated as a Magnet hospital for excellence in nursing Visit us at methodisthealth.com Follow us at twitter.com/MethodistHosp and www.facebook.com/MethodistHospital ***CONFIDENTIALITY NOTICE*** This e-mail is the property of The Methodist Hospital and/or its relevant affiliates and may contain restricted and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender and delete all copies of the message. Thank you. |
From: Rajagopalan, S. <SRa...@tm...> - 2011-05-04 18:31:19
|
Hi Everyone, I am making a movie and want to show the transition between a cartoon and a ribbon representation smoothly. So I tried inserting a simple python script like: Methodist. Leading Medicine. Recognized by U.S.News & World Report as one of America's "Best Hospitals" in 13 specialties. Named to FORTUNE magazine's "100 Best Companies to Work For" list five years in a row Designated as a Magnet hospital for excellence in nursing Visit us at methodisthealth.com Follow us at twitter.com/MethodistHosp and www.facebook.com/MethodistHospital ***CONFIDENTIALITY NOTICE*** This e-mail is the property of The Methodist Hospital and/or its relevant affiliates and may contain restricted and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender and delete all copies of the message. Thank you. |
From: Thomas H. <sp...@us...> - 2011-05-04 19:44:23
|
Hi Sena, the second argument to mdo was not correct, there you had two strings and a semicolon what must be one string and the semicolon within. Works for me like this: python cmd.mset("1x100") cmd.mdo(1, "set cartoon_transparency, 1.0; set ribbon_transparency, 0.0") for i in range(40,60): cmd.mdo(i, "set cartoon_transparency, %f; set ribbon_transparency, %f" % (1-(i-40)/20.0, (i-40)/20.0)) cmd.frame(1) python end Cheers, Thomas Rajagopalan, Senapathy wrote, On 05/04/11 19:50: > Hi Everyone, > > I am making a movie and want to show the transition between a cartoon > and a ribbon representation smoothly (fading out cartoon and fading in > ribbon) . > So I tried writing a simple python script like: > ------- > for i in range(40,60): > cmd.mdo (i, "set cartoon_transparency,%f" %( 1-(60-i)/60.0 ); "set > ribbon_transparency,%f" %( (60-i)/60.0 ) ) > ------- > > And > ------- > for i in range(40,60): > cmd.mdo (i, "set cartoon_transparency,%f" %( 1-(60-i)/60.0 ) ) > for j in range (40,60): > cmd.mdo (j, "set ribbon_transparency,%f" %( (60-j)/60.0 ) ) > ------ > > > And various other combinations, but none seem to produce the result that > I desire. Can anyone help me with the scripting as my python knowledge > is very basic. > > Thanks > Sena -- Thomas Holder MPI for Developmental Biology Spemannstr. 35 D-72076 Tübingen |