mcjChangeOrientation

Introduction

This script for Daz Studio lets you change the orientation of the axis around which your props/objects rotate when you

use the Rotate tool of the XRotate YRotate ZRotate parameters of the parameter tab

It also lets you change the location of the origin of the objects.

History

December 20th 2013 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

My DAZ 3D Library / Scripts / mCasual

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

USE

case 1 : no markers used

Select the target object in the scene

Launch the script

In the section titled ""Then orient the object's X Axis along ... "

select how your object's X Axis will be oriented

since you did not select any markers, you can not use the "Three-markers" option

if none of the 6 "world" vectors satisfy your needs, you may select the "this spin angle" button

and by trial-and-error find what you need

in the section titled "Orient The object's Y Axis according";

click on the button corresponding to the orientation of the Y Axis of your object

since you did not select any markers, you can not use the "Two markers vector" button

example:

A standard Primitives-Cylinder was created and rotated to stand like a tire

Due to the default axis configuration, it cant be used it in a steer-and-roll fashion

without resorting to nulls and parenting

Select "World Front +Z" as the orientation for the new X-Axis

and use the "World Up (+Y)" button for the new Y-Axis

The object's XRotate control can now be used to roll the tire and the Y Rotate can be used to steer it

case 2 : changing an object's Origin, one marker

place an object in your scene ( usually a Null node ) at the location of the desired new origin

this will be called "the marker"

select the marker

select the object that will have its origin modified

it's important the the nodes be selected exactly in this order

use the CTRL or the Shift key to build your selection

launch the script

click on the "Set origin to marker 1" button

example:

the pedal was imported into the scene but the origin of the pedal

is located in a way that makes the pedal inoperable

in fact the pedal's origin is 8 ft away!

i positioned the green cylinder at the correct location

selected the green cylinder

pressed the shift key

added the pedal to the selection

launched the script

clicked on the "Set origin to marker 1" button

greencyl

case 3 : Using 2 markers for the new Y-Axis

The line going from marker 1 to marker 2 will serve to re-orient the target object's Y-Axis

we will call this line "the vector"

position marker 1 ( usually a null ) at the base of the vector

normally this would also be the current or future "Origin" of the object

But it doesn't have to be.

For now all that matters is the orientation of the vector

position marker 2 ( usually a null ) at the end of the vector

Select marker 1, followed by marker 2, followed by the target object

launch the script

In the section titled ""Then orient the object's X Axis along ... "

select how your object's X Axis will be oriented

since you did not select 3 markers, you can not use the "Three-markers" option

if none of the 6 "world" vectors satisfy your needs, you may select the "this spin angle" button

and by trial-and-error find what you need

in the section titled "Orient The object's Y Axis according";

click on the "Two markers vector" button

example:

This door's hinges were not vertical pr horizontal and could not be operated using the standard rotation axis

so with the help of 2 null nodes and this script i was able to fix this !

case 4 : Using 3 markers for the total control the rotation frame

sometimes all the rotation axis of an object need to be modified

we will create 3 markers, which usually are null nodes ( part of Daz Studio's "create" menu )

the line going from marker 1 to marker 2 will serve as the new orientation for the object's Y Axis

and the line going from marker 1 to marker 3 will serve as the new orientation for the object's X Axis

position your 3 markers

select -- in this exact order -- marker 1, marker 2, marker3 and the target object

launch the script

In the section titled ""Then orient the object's X Axis along ... "

select "Three-markers"

in the section titled "Orient The object's Y Axis according";

use any of the six "World" buttons

example:

This mirror's ball joint needed odd orientations

the red cone's tip is marker 1, the green one is marker 2

this forms a vector with the same orientation as the mirror's support rod

marker 3 os the yellow cone tip,

with marker 1 it forms a vector perpendicular to the mirror surface

i use the "World Up Axis" button

I also used the occasion to move the mirror Origin to the position of marker 1 ... the red cone

Posing the mirror became easier

License

//===================================================================

// by mCasual/Jacques

//===================================================================

// ( MIT License )

// Copyright (c) <2013> <mCasual/Jacques>

// Permission is hereby granted, free of charge, to any person

// obtaining a copy of this software and associated documentation

// files (the "Software"), to deal in the Software without

// restriction, including without limitation the rights to use,

// copy, modify, merge, publish, distribute, sublicense, and/or sell

// copies of the Software, and to permit persons to whom the

// Software is furnished to do so, subject to the following

// conditions:

//

// The above copyright notice and this permission notice shall be

// included in all copies or substantial portions of the Software.

//

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,

// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES

// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT

// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,

// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

// OTHER DEALINGS IN THE SOFTWARE.

//===================================================================