Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let's have Flat Lighting Back ! #6

Open
tubiana opened this issue Feb 22, 2022 · 0 comments
Open

Let's have Flat Lighting Back ! #6

tubiana opened this issue Feb 22, 2022 · 0 comments

Comments

@tubiana
Copy link
Contributor

tubiana commented Feb 22, 2022

This would be great to have a button to have the old flat lighting back :-)
A issue was opened on molstar here, and a piece of code was suggested molstar/molstar#359 (comment)

I don't know it will help, but here's my change to have lighting settings in Flat dirrectly when I open a protein (on my custom version with molstar 2.3.5)

molstar.ts, line ~140

init(targetId: string, options?: {
        customColorList?: number[]
    }) {
        this.plugin = createPlugin(document.getElementById(targetId)!, this.defaultSpec);

        this.plugin.behaviors.canvas3d.initialized.subscribe(v => {
            if (v) {
                PluginCommands.Canvas3D.SetSettings(this.plugin, {                   
                    settings: {
                        renderer: {
                            ...this.plugin.canvas3d!.props.renderer,
                            style: { name: 'flat', params: {} }
                        },
                        camera: {
                            ...this.plugin.canvas3d!.props.camera,
                            mode: 'orthographic',
                            helper: { axes: { name: 'off', params: {} } }
                        },
                        postprocessing: {
                            ...this.plugin.canvas3d!.props.postprocessing,
                            outline: {
                                name: 'on', params: {
                                    scale: 3.0,
                                    threshold: 1
                                }
                            }
                        }

                    }
                });
            }
        });
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant