Dear Armando,
   I think documentation is probably quite lacking in this area.
Scripting can be initiated with "Calculate -> Interactive
scripting..." .

Then, if you have a molecule loaded (and Ribbons displayed), typing
something like the following into the box and then clicking the arrow
should make all ribbon representations transparent grey:

Object.keys(molecules).forEach(key=>{
 const molecule = molecules[key]
 molecule.representations.forEach(rep=>{
   if (rep.style === 'CRs'){
    rep.buffers.forEach(buffer=>{
     buffer.setCustomColour([0.5, 0.5, 0.5, 0.5])
    })
   }
 })
 molecule.glRef.current.buildBuffers(); // These 2 lines are likely
 molecule.glRef.current.drawScene();  // to be different in future.
})

So the scripting is JavaScript, there are global "molecules" and
"maps" objects and one writes scripts that run methods of the map and
model objects.

But what to type is difficult without examining the source code for
MoorhenMap and MoorhenMolecule objects.
https://github.com/moorhen-coot/Moorhen/baby-gru/src/utils

But you have convinced me we need to write some documentation on this.

Best wishes,
Stuart

On Tue, 24 Jun 2025 at 09:01, Armando Albert <[email protected]> wrote:
>
> Dear all
> Does anyone know how to script in moorhen?
> Armando
>
> ########################################################################
>
> To unsubscribe from the CCP4BB list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1
>
> This message was issued to members of www.jiscmail.ac.uk/CCP4BB, a mailing 
> list hosted by www.jiscmail.ac.uk, terms & conditions are available at 
> https://www.jiscmail.ac.uk/policyandsecurity/

########################################################################

To unsubscribe from the CCP4BB list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1

This message was issued to members of www.jiscmail.ac.uk/CCP4BB, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/

Reply via email to