maxscript

Denormalize vector

瘦欲@ 提交于 2019-12-01 10:40:14
How can I denormalize a vector that has been normalized to get the original values prior to normalizing? For example: vec = [-0.5, -1.0, 0.0] vec_length = sqrt(vec.x^2 + vec.y^2 + vec.z^2) vec_normalized = [vec.x/vec_length, vec.y/vec_length, vec.z/vec_length] yields: vec_length = 1.11803 vec_normalized = [-0.447214,-0.894427,0] How can I get the original vector [-0.5, -1.0, 0.0] from the normalized vector [-0.447214,-0.894427,0]? Thanks! You can't. There are infinite number of vectors whose normalized form is [-0.447214, -0.894427, 0] . If you want a "nicer" form, you can try up-scaling to an

A QApplication instance already exists

时间秒杀一切 提交于 2019-11-29 07:23:59
I'm doing some simple PySide on 3Dsmax 2015. This is my error: python.ExecuteFile "C:\Program Files\Autodesk\3ds Max 2015\scripts\Python\demoUniTest.py" -- Runtime error: Line 32 <module>() <type 'exceptions.RuntimeError'> A QApplication instance already exists. This is my code: import sys from PySide.QtCore import * from PySide.QtGui import * from math import * class Form(QDialog): def __init__(self,parent=None): super(Form,self).__init__(parent) self.browser = QTextBrowser() self.lineedit = QLineEdit("Type an expression and press Enter") self.lineedit.selectAll() layout = QVBoxLayout()