mcjStickyDome

══════════════════

Introduction

══════════════════

This script measures the World-Space Y-Rotation of the camera and adjusts the Dome Rotation of the Environment Options Node accordingly. 


══════════════════

History

══════════════════

September 17th 2023 - mcjStickyDome000NoUI  release



══════════════════

Installation

══════════════════

The zip package is found at the bottom of this page

unzip it in your daz content folder, typically

C:\Program Files\DAZ\Studio\content\

or

C:\Program Files (x86)\DAZ\Studio\content\

once installed, it will appear in your content library, under Studio / Scripts / mcasual

or

C:\Users\Public\Documents\My DAZ 3D Library\

once installed, it will appear in your content library, under My DAZ 3D Library / Scripts / mcasual


══════════════════

Use

══════════════════

You dont need to select anything, the script will find the current/active  viewport camera and the environment node


══════════════════

Source code

══════════════════

// DAZ Studio version 4.21.0.5 filetype DAZ Script

//mcjStickyDome000NoUI - 2023-09-17 by mCasualJacques

var vmgr = MainWindow.getViewportMgr();

var vport = vmgr.getActiveViewport().get3DViewport();

var camera = vport.getCamera();

var camR = camera.getWSRot()

var camVF = camR.getZAxis();

var ang = Math.atan2( camVF.x, camVF.z ) * 180 / Math.PI;

var env = Scene.findNodeByLabel( "Environment Options" )

var prop = env.findProperty( "Dome Rotation" );

prop.setValue( 180 - ang );