CGTalk > Software > Maxon Cinema 4D
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 10-25-2013, 03:37 PM   #1
AdsovonMelk
Expert
 
AdsovonMelk's Avatar
Grzegorz
Poland
 
Join Date: Apr 2006
Posts: 228
Reset PSR to worplane origin

Recently I've discovered that there is no easy way to move already existing object to workplane origin. Align to workplane command only orientates and move selected object to closest point on workplane, not to its origin. There is GetWorplaneMatrix function in python sdk so i think it should be quite easy to write simple script to allow this functionality. Also it would be nice to have functionality to move only axis of an object or selected points/edges/polygons axis to workplanes origin when Enable Axis is turned on. This way we would have something like 3d cursor in Blender but one that can be turned of. Unfortunately I'm programing disabled so maybe someone have five minutes to spare on writhing this script.

Last edited by AdsovonMelk : 10-25-2013 at 10:30 PM.
 
Old 10-25-2013, 07:37 PM   #2
kvb
Now with Less Gout!
 
kvb's Avatar
Kevin V. Barnum
Graphic Designer/3D Artist
Colorvision International
Orlando, USA
 
Join Date: Jan 2007
Posts: 813
::EDIT:: Disregard, reset psr + align selection to workplane doesn't work in a consistent manner.
__________________
www.kvbarnum.com
LOBODESTROYO!!!

Last edited by kvb : 10-25-2013 at 07:42 PM.
 
Old 10-25-2013, 08:22 PM   #3
littledevil
Meh
 
littledevil's Avatar
portfolio
Ferdinand
Germany
 
Join Date: Aug 2002
Posts: 616
something like that might work: http://codepad.org/68TXY0mT. it will align all currently
selected objects to the active BaseDraws workplane matrix. if you do press ctrl or shift
while executing the script it will 'move' the axis (actually you cannot move the axis, but
you have the move the points). i have forced myself to include some comments, so that
it is not just some gibberish.

fyi : i have not implemented rotations for the axis mode and please do not post in times
new roman, it is just awful to read.
__________________
There are holes in the sky. Where the rain gets in.
But they're ever so small. That's why the rain is thin.

Last edited by littledevil : 10-25-2013 at 08:29 PM.
 
Old 10-25-2013, 08:58 PM   #4
AdsovonMelk
Expert
 
AdsovonMelk's Avatar
Grzegorz
Poland
 
Join Date: Apr 2006
Posts: 228
Quote:
Originally Posted by littledevil
something like that might work: http://codepad.org/68TXY0mT. it will align all currently
selected objects to the active BaseDraws workplane matrix. if you do press ctrl or shift
while executing the script it will 'move' the axis (actually you cannot move the axis, but
you have the move the points). i have forced myself to include some comments, so that
it is not just some gibberish.

fyi : i have not implemented rotations for the axis mode and please do not post in times
new roman, it is just awful to read.


Thanks for reply, i will check the script. Sorry for this Times new roman thing, something was broken in my editor.
 
Old 10-25-2013, 10:50 PM   #5
AdsovonMelk
Expert
 
AdsovonMelk's Avatar
Grzegorz
Poland
 
Join Date: Apr 2006
Posts: 228
Unfortunately it's not working for some reason. Maybe I'm missing something.
Thanks anyway.
 
Old 10-26-2013, 09:01 AM   #6
littledevil
Meh
 
littledevil's Avatar
portfolio
Ferdinand
Germany
 
Join Date: Aug 2002
Posts: 616
sure it does work.
__________________
There are holes in the sky. Where the rain gets in.
But they're ever so small. That's why the rain is thin.
 
Old 10-26-2013, 09:12 PM   #7
AdsovonMelk
Expert
 
AdsovonMelk's Avatar
Grzegorz
Poland
 
Join Date: Apr 2006
Posts: 228
So I'm doing something wrong.
This is the code I'm executing on polygonal object with model mode and move tool enabled.
Attached Images
File Type: png Code.PNG (47.1 KB, 9 views)
 
Old 10-26-2013, 11:28 PM   #8
littledevil
Meh
 
littledevil's Avatar
portfolio
Ferdinand
Germany
 
Join Date: Aug 2002
Posts: 616
which version of c4d are you using ? might be some sdk version problem if you are using
r12 or r13 (although i think none of the used methods has been subject of changes). the
script does run fine for me on r14/15. please post your console output here or i won't be
able to help you.

on a more general note, i am not quite sure if the functionality of the script has been made
clear enough by me. the script won't care for the editor mode. it also does not care if enable
axis is turned on, unless you uncomment the respective line.

the script will try for each selected object in the object manager :

1. apply the workplane matrix to the object, which will work for all object types.
2. if you press ctrl/ctrl to do the axis thingy, unless the object is not editable (case 1 then).
__________________
There are holes in the sky. Where the rain gets in.
But they're ever so small. That's why the rain is thin.

Last edited by littledevil : 10-26-2013 at 11:31 PM.
 
Old 10-26-2013, 11:28 PM   #9
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:07 AM.


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