The Molecular Graphics Laboratory Forum

AutoDock, AutoLigand, MGLTools, Vina, PyRx and more.
It is currently Mon Dec 18, 2017 2:37 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Dec 17, 2012 10:10 pm 
Offline
Millimolar User
Millimolar User
User avatar

Joined: Sat Mar 05, 2011 6:35 pm
Posts: 4
Hi,

I'm using C4D R 14 with ePMV, and I'm interested in using keyframing a trajectory. Is there a python command to advance the data player by a given number of steps? I'd like to write a script to automatically keyframe. something like

----------------------
import c4d
from c4d import documents, plugins

#define trajectory length and stepsize
frames = 100
stepsize = 1

loop = range (frames + 1)
while loop.pop():

#advance dataplayer by stepsize
??

#advance timeline one frame
c4d.CallCommand(12414)

#keyframe selected
c4d.CallCommand(12410)




--------------------------------


Thanks for the help,

Dan


Top
 Profile  
 
PostPosted: Mon Dec 17, 2012 10:14 pm 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
Hi,

the data player can be synchronized with the timeline through the options.
if you open ePMV preferences
check
- Viewport changes modify PDB data / synchonize realtime (depending the ePMV version)
- Synchronize data player to timeline and specify how many step per frame you want.

If you want something more complex let me know I can guide you through the scripting of C4D/ePMV

Ludo


Top
 Profile  
 
PostPosted: Tue Dec 18, 2012 12:14 am 
Offline
Millimolar User
Millimolar User
User avatar

Joined: Sat Mar 05, 2011 6:35 pm
Posts: 4
Thanks Ludo. I'm trying to learn ePMV and C4D at the same time, so I apologize in advance if I'm missing something obvious.

Checking those boxes doesn't seem to change anything for me compared to when they weren't checked. I can scroll through the dataplayer and watch the molecule move, but the timeline doesn't change, and when I scroll through the timeline, the dataplayer doesn't change.

Could you post a little more detail on how one might perform keyframing of the trajectory? I can do it inefficiently by selecting all children of the _cpk null object, clicking forward one step on the dataplayer slider, keyframing positions of all cpk instances in the viewport, moving ahead one frame, and then repeating. More details on how to make this automatic would be much appreciated.

Dan


Top
 Profile  
 
PostPosted: Tue Dec 18, 2012 3:40 am 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
Hi

so I did a small video capture to show you what to except with the synchro real-time and the synchro timeline check box in the preference.
also note that before loading the molecule I uncheck the center mol in the preference.
I used a NMR model but it is working with any kind of model data (NMR, gromacs traj, dlg docking results)
I used our latest release of ePMV that you can find here which come with autoPack :
http://autopack.org/install/cinema-4d-installation
It will be nice if you could actually try the installer, and let me know how it goes.

the video is here :
http://www.youtube.com/watch?v=pCwdDTHXDfU

thanks
Ludo


Top
 Profile  
 
PostPosted: Tue Dec 18, 2012 3:37 pm 
Offline
Millimolar User
Millimolar User
User avatar

Joined: Sat Mar 05, 2011 6:35 pm
Posts: 4
Hi Ludo,
For reference, I'm using Windows 7 Ultimate, 64-bit and C4D R14 (64-bit Demo).

The installer worked pretty well- thanks for making that an option. Minor suggestions for improvement: The installer failed to autodetect the C4d plugin directory, and at that point the instructions became a little confusing. It would be helpful to label the example paths as Mac and PC to avoid confusion. I did know which was which, yet still, when I manually navigated to the plugin folder, I got an error message, and was sent back to the top of the directory to try again. I had to select the C4D preferences folder (which contains the plugin folder), and not the c4D user preferences Plugin folder, as the instructions imply.

Your video was very helpful, and I can reproduce the same results with my trajectory. I can animate with the worm as you demonstrated, as well as with metaballs and lines. MSMS representation gives me a crazy flickering color effect across the surface mesh. But I was most interested in using CPK. Unfortunately, although animation of atoms is only visible in the viewport, when I try to render I only get a still image. For 'Sticks' I get no synchronization at all.

Also, I noticed that if the scene is saved, synchronization is lost immediately. I can't get it back even if I close the file and start a new file- I have to exit and restart C4D to get the synchronization to work again.

The most important feature to me right now is the ability to render animation of CPK and/or stick representations. Lastly, could you explain why you want to uncheck "center molecule to origin" in the preferences?
Thanks


Top
 Profile  
 
PostPosted: Tue Dec 18, 2012 4:32 pm 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
Hi,
thank you very much for the feedback it help a lot.
There is no easy way to automatically detect the C4D preference folder, so you have to browse to it. and yes you need to select the parent. The instruction should be more precise I agree.
When you are using MSMS or CMS and the dataplayer you need to check: update color in the preference. When you update the coordinate, thus the surface, the vertex color have to be recomputed...
You dont want to center the molecule, as I dont think we center the trajectory data. that means that if the trajectory data is offset and you center the molecule, first frame will be at center, at frame 1 (conformation 1) it will jump at the center of the traj.

about the rendering, this shouldn't happen. I didnt check if it was working in R14. maybe some API change..I will see if I can find a fix, and push an update.

Ludo


Top
 Profile  
 
PostPosted: Wed Dec 19, 2012 4:19 pm 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
I cant reproduce the error on Mac using either R12 or R13. I will try on windows and R14 see how it goes.
Ludo


Top
 Profile  
 
PostPosted: Wed Dec 19, 2012 8:55 pm 
Offline
Millimolar User
Millimolar User
User avatar

Joined: Sat Mar 05, 2011 6:35 pm
Posts: 4
Ludo,
Just giving you an update in case its helpful. Although I haven't been able to solve the problem yet, I do notice that the problems I've having with dataplayer animation are only an issue with instanced objects; cpk and ball-an-stick. I tried checking "render instance" on these objects but nothing changed.

No progress on the other issue, regarding saving- when the file is saved, the connection between the timeline and the dataplayer is severed, and apparently can't be restored.

Dan


Top
 Profile  
 
PostPosted: Wed Dec 19, 2012 9:44 pm 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
thanks for the update.
I will look into it and try to find a fix.
I am quite busy with the contest that started but should find some moment.
Please have a look to it if you didn't have yet :
http://autopack.cgsociety.org/autopack

L


Top
 Profile  
 
PostPosted: Wed Dec 19, 2012 10:38 pm 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
ok I fix it,
the atoms and cpm were not properly updating. it should work now.
Can you try to update from inside ePMV:in ePMV go to Help->Check for update
update
restart

let me know how it goes
thanks
L


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
POWERED_BY
Translated by Maël Soucaze © 2009 phpBB.fr