# Problem assigning rotation to the particlevector

THREAD CLOSED
 Thread Tools Display Modes
 08 August 2010 reForm Expert portfolio Patrick Macdonald CG Artist reForm Studios London, United Kingdom Problem assigning rotation to the particlevector I hope someone can help, I'm trying to use a pflow script to have object chunks return to their position AND rotation. The position is working fine if I set the pCont.particleVector = ChunksArray[i].pos But... if the chunks are spinning, they do not return to their original rotations. Setting the particlevector to ChunchsArray[i].transform causes the script to fail.... `````` pCont.particleIndex = i vpos = ChunksArray[i].transform pCont.particleVector = vpos`````` Does the particlevector allow you to save the rotation aswell as the position of a particle chunk? If so, how do I assign the rotation to the particlevector? Here's my birthscript. `````` on ChannelsUsed pCont do ( pCont.useAge = true pCont.useTM = true pCont.useVector = true ) on Init pCont do ( global ChunksArray = \$Teapot* as array global TM_Reset -- TM_Reset = undefined if ChunksArray != undefined do ( if TM_Reset == undefined do TM_Reset = true if TM_Reset do ( Global ChunksArray_TM = for i in ChunksArray collect i.transform TM_Reset = false ) ) ) on Proceed pCont do ( t = pCont.getTimeStart() as float NumChunks = ChunksArray.count if t < 0 do ( for i = 1 to NumChunks do ( pCont.AddParticle() pCont.particleIndex = pCont.NumParticles() pCont.particleAge = 0 pCont.particleTM = ChunksArray_TM[i] pCont.particleIndex = i vpos = ChunksArray[i].pos pCont.particleVector = vpos ) ) ) on Release pCont do ()`````` Thanks for any help! Cheers p. __________________ Patrick Macdonald Lighting TD : http://reformstudios.com Developer of Mission Control , the spreadsheet editor for 3ds Max share quote
08 August 2010
Yes you can store rotation but the particleVector channel only holds one set of vector values, in this case you need at least 2, one for rotation and one for position. Seems we talked about this recently and I am trying to find a sample I whipped up.

A possible solution is to use the particleMatrix channel instead. This gives you the option to store up to 4 sets of vector data, 12 floats, or a single matrix. Just be aware that you need to assign your rotation and position values to a variable before inserting them into the matrixChannel.

You have box#3 don't you? It is way simpler/faster in a data op. You'd simply add a new in event piped to a input standard->position and a input standard->rotation, convert to matrix (select an appropriate channel for each) the out to a output standard-> Script Matrix or out to there own custom data channels for use later.

Then just recall these values in another data op downstream.

I couldn't find the scripted example I did earlier so I made another one. It uses both a Vector and a Matrix channel with a Go To Rotation and a Find Target.

EDIT: argh, something is wrong with the way particleOrientation is storing, it doesn't appear to be correct, I inserted a duplicate flow using data ops work work as they should, the scripted version is bungled for some reason. Working on it...

EDIT EDIT: Seems to be a time accuracy issue, just guessing

Anyway here is that scripted version with a simple box#3 setup in it.
Max2010
Attached Files
 max2010_PF_mxsVectorPosMatrixRot_01.zip (33.2 KB, 33 views)
__________________
poof ~>Vimeo<~

Last edited by JohnnyRandom : 08 August 2010 at 09:11 PM.

08 August 2010
Hey Jonny,
Thanks so much for taking a look at this for me!
I tried your two pflows but I'm struggling to get then to work adequately with object chunks (through a birth script).
Using the data operators, the rotations appear to be working now, but not the positions!
I also noticed in your sample maxfile there are two problems: the rotation doesn't appear to smoothly rotate back to the original orientation, rather it snaps into place in the last frame before stopping. The position also seems inaccurate, but I think you already noticed this... and yes it looks like it's a timing issue.

I've attached your original scene but adjusted to object chunks, and my other scene using object chunks... (max2011 and 2009 respectively).
http://www.reformstudios.com/03-res...m_Lozenge01.zip
I wonder if any other pflow gurus can shed some light on where we might be going wrong?

Thanks again!
Attached Files
 max2010_PF_mxsVectorPosMatrixRot_02.zip (32.0 KB, 19 views)
__________________
Patrick Macdonald
Lighting TD : http://reformstudios.com
Developer of Mission Control
, the spreadsheet editor for 3ds Max

 08 August 2010 JohnnyRandom Configurator   portfolio John Rand still wandering the binary void salt lake city, USA No worries, be better if I could nail it down. Me and rotations we are so tight...I think they hate me Anyway, I tried to emulate the script version as close as possible with box#3 (as simple as it is). To get exact Position/Rotation/Scale using the Transform Matrix never seems to fail. So input the TM in the first op (while leaving the Particle Vector for use with Find Target) Output New it to a new global channel and recall it in the last event (everything should then match up tick for tack). The slow rotation in can be fixed with a Go To Rotation test, I had one but omitted it to make sure the operators were behaving correctly. hmm, couldn't seem to grab the scene file? __________________ poof ~>Vimeo<~ share quote
 08 August 2010 JohnnyRandom Configurator   portfolio John Rand still wandering the binary void salt lake city, USA Looked at your scene, as mentioned switch the Euler Angles to TM-Matrix instead, rewire the final data op to reflect the change to TM. This seems to work ok: Shot_150_Forum_Lozenge02.zip __________________ poof ~>Vimeo<~ share quote
 08 August 2010 reForm Expert portfolio Patrick Macdonald CG Artist reForm Studios London, United Kingdom You, Sir, are a genius... ! That worked perfectly.... what a result! Thanks again! __________________ Patrick Macdonald Lighting TD : http://reformstudios.com Developer of Mission Control , the spreadsheet editor for 3ds Max share quote
 08 August 2010 CGTalk Moderation Expert Thread automatically closed This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote
 Thread Closed share thread

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
 Please select one User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Gallery     Latest Entries     Featured 2D     Featured 3D     CG Awards     Community Awards Main     News     General Discussion     Off Topic     Recruitment         Temp Job Board Challenges     CGS Environment 101     Education     Demo Reel     Portfolio Review GROUPS WIP ADVICE     CGS Pro     Art Direction and Interviews     New 2D/3D Sketchbooks 2018     WIP 2D/3D & Animation         WIP/Critique: 3D         WIP/Critique: 2D             Speedpaints & Sketchbooks         WIP/Critique: Animation     Partners and Groups         Kitbash 3D Thunderdome         Collaborative Projects Autodesk     Autodesk Maya         Maya Dynamics         Maya Rendering         Maya Character Setup         Maya Programming     Autodesk Miscellaneous         Autodesk MotionBuilder         Autodesk Mudbox         Autodesk Softimage             XSI: Programming             ICE: Interactive Creative Environment     Autodesk 3ds max         3dsMax Tutorials & Tips         3dsMax Resources         3dsMax SDK and MaxScript         Plugins & Add-ons         Particle Flow     Mudbox Featured Gallery ZBrush     Featured Zbrush Gallery     Pixologic ZBrush     Keyshot     Marvelous Designer Texturing     Allegorithmic Substance         Substance Designer         Substance Painter         Substance Featured Gallery     Texturing XYZ     Mari     Marmoset Toolbag Software     Maxon Cinema 4D         Cinema 4D Resources     Side Effects Houdini     Compositing Software         The Foundry Nuke         Adobe After Effects         Autodesk Effects and Compositing         Eyeon Software Digital Fusion     Additional Software         Lightwave 3D             LW Resources             LW Tutorials         The Foundry Modo             The Foundry Time Travel Challenge         E-on Software Vue         Photoshop / Painter         Blender         3DCoat Techniques     Art Techniques and Theories     Digital Matte Painting         Digital Matte Painting Mini-Challenge     Modeling         Modeling Challenge             Member Model Collection     Texturing and Surfacing     Character Rigging     Animation     Lighting and Shaders         Lighting Challenges     Compositing and Editing     Anatomy and Figurative Art         SPOTLIGHT: Best of the Artistic Anatomy and Figurative Art Forum         Tutorials and Workshops         Personal Anatomy & Sketchbook Threads         References, Resources, and Supplies Technical     VR/AR     Master Virtual Reality with BrioVR     Workstation Builds     Game Engine     Graphics Programming     Technical and Hardware CGS Labs     Sketchbooks     Hardcore Crit     Discussions and Meet Ups
Miscellaneous

All times are GMT. The time now is 02:17 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.