Re: [Bf-committers] Make Parent - shouldn't it work differently?
In one of the previous posts I explained what I do to get proper relation between parent and child and not to lose the position, rotation and scale of the child at the moment of parenting. The script that I use does this: 1. Stores the current world matrix of the child. 2. Makes parent without inverse 3. sets world matrix of child to previously stored world matrix of the child. a - parent b - child m = b.matrix_world b.parent = a b.matrix_world = m Tested it, it works great, I made an operator from it, assigned keyboard shortcut and I use it regularly. I can live with current behavior, especially that I don't use it :-) I have my own hack, but I simply think that this should be default. Bartek Skorupa www.bartekskorupa.com On 22 wrz 2012, at 00:14, Bassam Kurdali bas...@urchn.org wrote: I don't think it should happen by default. it could be especially nasty for animation data, linked data, etc. Also it doesn't store as much information (the relationship between child and parent at the time of parenting) which could come in handy later. However, it is not hard to do! You need for that is to multiply the inverse transform matrix with the world transform matrix. I think - I may have gotten the order wrong. so, an easy way : 1- do a normal parent operator (creates inverse transform matrix) 2- multiply the inverse transform and the regular matrix for the object 3- clear inverse transform 4- put the matrix from 2 into the transform for the object. I think 4 is a bit more complicated, because I *think* that the matrices are read-only, so you'll have to decompose into translation/rotation/scale (mathutils provides all those functions anyway) bundle that up into an operator and you're home free. Another good option is just to calculate the inverse parent and avoid doing the parent-clear inverse dance. If this is done in blender internally the same code could be used to avoid having two code paths. one possibility for blender behavior is to have a parent menu, with a few choices, similar to the un-parent, and keep the current behavior the top/default choice. On Fri, 2012-09-21 at 21:11 +0200, Bartek Skorupa (priv) wrote: Thank you. However we are only half way there. It solves the major issue as we at least don't have weird properties of the child. The question still remains: How to make a parent such that the child stays at it's current location, rotation and scale, but the values of loc/rot/scale change. This is what should happen by default. @Bassam Kurdali: You wrote: the default behaviour should be kept, of course. Most users want this. I wouldn't agree with that. I'm scratching my head trying to figure out at least one benefit of current default behavior and can't find anything. Is there any good reason for destroying the order in the scene? Having objects with locations, rotations and scales set in relation to who-the-hell-knows what? What do I miss? Bartek Skorupa www.bartekskorupa.com On 21 wrz 2012, at 20:44, Remigiusz Fiedler mig...@gmx.net wrote: no ctrl needed, it is alt p - clear inverse parent 2012/9/21 Bartek Skorupa (priv) bartekskor...@bartekskorupa.com: Ctl-Alt-P ?? When I hit it I get a warning: Can only make proxy for a referenced object or group What do I miss? ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
Hi everyone, I'd like to discuss the issue that I encounter every time I want to make a simple parenting structure of objects: Let's parent object A to object B. Select A, then select B, and hit Ctl-P. Here's what happens: A didn't change its visual transformations, it stayed exactly where it was before, it's visual rotation and scale didn't change as well. However now it is a child of B, so it should use B's co-ordinates as its center of the world. If A stayed where it was before - its transform properties should change to reflect it's position, rotation and scale in relation to B, right? This isn't happening. A's transform properties remained untouched. When we clear origin (alt-O) - A moves to location of B. It's transform properties din't change. Now they represent co-ordinates in relation to …. exactly …. to no-one-knows-what. There is of-course the option to parent objects using Shift-Ctl-P. This creates proper relation between A's transform properties and its visual transformations, but it as well moves A to B's location and it's not always the desired result. There is no easy way to make true parent. It would be great if after hitting Ctl-P - child stayed where it is, but its transform properties would be recalculated such that they represent transformations in relation to parent. Hitting Shift-Ctl-P should in my opinion make parent, leave transform properties of the child untouched, but move, rotate and scale the child such that now it's transformed properly in relation to its parent. I find it easier to create proper parenting structure using python, than keyboard shortcuts. Is there anyone else who feels the same? What do you think? Cheers Bartek Skorupa ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
Maybe some way to display/tweak the local transform would solve this? ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
From a user perspective I agree with your assertion. For a possible solution I'd suggest something like a [Global | Local] switch in the Transform dialog(s). That should be pretty universal. I'm not sure if this is easily possible from the programming side though. Best regards, Martin ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
Hi Bartek, there is a non-exposed(a shame!) feature in parenting routine: For non-inverse-mode press Shift-Ctrl-P instead. This creates an alternative parent-child-relationship where child-objects exist entirely in parent coordinate system. This is the better choice for CAD purposes for example. cheers migius ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
oops, haven't read your post to the end There is of-course the option to parent objects using Shift-Ctl-P. This creates proper relation between A's transform properties and its visual transformations, but it as well moves A to B's location and it's not always the desired result. ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
In order to get proper parenting I use a little script: active = bpy.context.active_object selected = boy.context.selected_objects for c in selected: if c =! active: m = c.matrix_world c.parent = active c.matrix_world = m This gives me the behavior that I'd like to have under Ctl-P The behavior that I'd like to have under Shift-Ctl-P would be this: active = bpy.context.active_object selected = boy.context.selected_objects for c in selected: if c =! active: c.parent = active Cheers Bartek Skorupa www.bartekskorupa.com On 21 wrz 2012, at 11:08, Remigiusz Fiedler mig...@gmx.net wrote: oops, haven't read your post to the end There is of-course the option to parent objects using Shift-Ctl-P. This creates proper relation between A's transform properties and its visual transformations, but it as well moves A to B's location and it's not always the desired result. ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
Yes, yes, I know… I made a mistake: it should be: if c != active: :-) Bartek Skorupa www.bartekskorupa.com On 21 wrz 2012, at 11:49, Bartek Skorupa (priv) bartekskor...@bartekskorupa.com wrote: In order to get proper parenting I use a little script: active = bpy.context.active_object selected = boy.context.selected_objects for c in selected: if c =! active: m = c.matrix_world c.parent = active c.matrix_world = m This gives me the behavior that I'd like to have under Ctl-P The behavior that I'd like to have under Shift-Ctl-P would be this: active = bpy.context.active_object selected = boy.context.selected_objects for c in selected: if c =! active: c.parent = active Cheers Bartek Skorupa www.bartekskorupa.com On 21 wrz 2012, at 11:08, Remigiusz Fiedler mig...@gmx.net wrote: oops, haven't read your post to the end There is of-course the option to parent objects using Shift-Ctl-P. This creates proper relation between A's transform properties and its visual transformations, but it as well moves A to B's location and it's not always the desired result. ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
What i would like to see here is stack based (modo) or nodal (maya) transforms- that way you could: expose inverse parent transform get rid of hard coded dx dy dz transforms expose constraint offset transforms, and simplify constraints expose child of constraint freeze transforms ala maya by popping a transform onto stack stack as many offsets as you need for rigging get rid of hard coded transform/constraint order of evaluation get rid of confusion that hidden transforms cause make all hidden transforms editable some of the benefits I list assume of course that constraints and perhaps parenting are also in the stack/node tree. Most of the previous list is not currently possible. As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. Not sure if there is an operator that just does that (though editing the parent property in the properties editor does. Does it have copy to selected? ) the default behaviour should be kept, of course. Most users want this. On Fri Sep 21 2012 05:08:08 AM EDT, Remigiusz Fiedler mig...@gmx.net wrote: oops, haven't read your post to the end There is of-course the option to parent objects using Shift-Ctl-P. This creates proper relation between A's transform properties and its visual transformations, but it as well moves A to B's location and it's not always the desired result. ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
+1 to Bassam Kurdali's proposal :-) ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
A transform stack has got my vote. :-) Realistically that's probably still a ways off, though. As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. Not sure if there is an operator that just does that It wouldn't be hard to script up an operator using those two operators. --Nathan On Fri, Sep 21, 2012 at 7:16 AM, Bassam Kurdali bas...@urchn.org wrote: What i would like to see here is stack based (modo) or nodal (maya) transforms- that way you could: expose inverse parent transform get rid of hard coded dx dy dz transforms expose constraint offset transforms, and simplify constraints expose child of constraint freeze transforms ala maya by popping a transform onto stack stack as many offsets as you need for rigging get rid of hard coded transform/constraint order of evaluation get rid of confusion that hidden transforms cause make all hidden transforms editable some of the benefits I list assume of course that constraints and perhaps parenting are also in the stack/node tree. Most of the previous list is not currently possible. As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. Not sure if there is an operator that just does that (though editing the parent property in the properties editor does. Does it have copy to selected? ) the default behaviour should be kept, of course. Most users want this. On Fri Sep 21 2012 05:08:08 AM EDT, Remigiusz Fiedler mig...@gmx.net wrote: oops, haven't read your post to the end There is of-course the option to parent objects using Shift-Ctl-P. This creates proper relation between A's transform properties and its visual transformations, but it as well moves A to B's location and it's not always the desired result. ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
2012/9/21 Bassam Kurdali bas...@urchn.org: As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. no, unfortunately not - it produces different results ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. no, unfortunately not - it produces different results I roll it back - this works! but parenting with shift ctrl p produces not exactly what we (CAD people) need: it transfers child object to parent's coordinates system inclusive child's xyz-orientation but dropping its xyz-location vector ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
Ctl-Alt-P ?? When I hit it I get a warning: Can only make proxy for a referenced object or group What do I miss? Bartek Skorupa www.bartekskorupa.com On 21 wrz 2012, at 17:06, Nathan Vegdahl ces...@cessen.com wrote: A transform stack has got my vote. :-) Realistically that's probably still a ways off, though. As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. Not sure if there is an operator that just does that It wouldn't be hard to script up an operator using those two operators. --Nathan On Fri, Sep 21, 2012 at 7:16 AM, Bassam Kurdali bas...@urchn.org wrote: What i would like to see here is stack based (modo) or nodal (maya) transforms- that way you could: expose inverse parent transform get rid of hard coded dx dy dz transforms expose constraint offset transforms, and simplify constraints expose child of constraint freeze transforms ala maya by popping a transform onto stack stack as many offsets as you need for rigging get rid of hard coded transform/constraint order of evaluation get rid of confusion that hidden transforms cause make all hidden transforms editable some of the benefits I list assume of course that constraints and perhaps parenting are also in the stack/node tree. Most of the previous list is not currently possible. As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. Not sure if there is an operator that just does that (though editing the parent property in the properties editor does. Does it have copy to selected? ) the default behaviour should be kept, of course. Most users want this. On Fri Sep 21 2012 05:08:08 AM EDT, Remigiusz Fiedler mig...@gmx.net wrote: oops, haven't read your post to the end There is of-course the option to parent objects using Shift-Ctl-P. This creates proper relation between A's transform properties and its visual transformations, but it as well moves A to B's location and it's not always the desired result. ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
no ctrl needed, it is alt p - clear inverse parent 2012/9/21 Bartek Skorupa (priv) bartekskor...@bartekskorupa.com: Ctl-Alt-P ?? When I hit it I get a warning: Can only make proxy for a referenced object or group What do I miss? ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
many apologies of course it's only alt-p the same hotkey for unparenting. On Fri, 2012-09-21 at 20:37 +0200, Bartek Skorupa (priv) wrote: Ctl-Alt-P ?? When I hit it I get a warning: Can only make proxy for a referenced object or group What do I miss? Bartek Skorupa www.bartekskorupa.com On 21 wrz 2012, at 17:06, Nathan Vegdahl ces...@cessen.com wrote: A transform stack has got my vote. :-) Realistically that's probably still a ways off, though. As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. Not sure if there is an operator that just does that It wouldn't be hard to script up an operator using those two operators. --Nathan On Fri, Sep 21, 2012 at 7:16 AM, Bassam Kurdali bas...@urchn.org wrote: What i would like to see here is stack based (modo) or nodal (maya) transforms- that way you could: expose inverse parent transform get rid of hard coded dx dy dz transforms expose constraint offset transforms, and simplify constraints expose child of constraint freeze transforms ala maya by popping a transform onto stack stack as many offsets as you need for rigging get rid of hard coded transform/constraint order of evaluation get rid of confusion that hidden transforms cause make all hidden transforms editable some of the benefits I list assume of course that constraints and perhaps parenting are also in the stack/node tree. Most of the previous list is not currently possible. As for the current behaviour, if you: ctrl p then ctrl alt p - clear inverse parent i believe you'll have what you want. Not sure if there is an operator that just does that (though editing the parent property in the properties editor does. Does it have copy to selected? ) the default behaviour should be kept, of course. Most users want this. On Fri Sep 21 2012 05:08:08 AM EDT, Remigiusz Fiedler mig...@gmx.net wrote: oops, haven't read your post to the end There is of-course the option to parent objects using Shift-Ctl-P. This creates proper relation between A's transform properties and its visual transformations, but it as well moves A to B's location and it's not always the desired result. ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
Thank you. However we are only half way there. It solves the major issue as we at least don't have weird properties of the child. The question still remains: How to make a parent such that the child stays at it's current location, rotation and scale, but the values of loc/rot/scale change. This is what should happen by default. @Bassam Kurdali: You wrote: the default behaviour should be kept, of course. Most users want this. I wouldn't agree with that. I'm scratching my head trying to figure out at least one benefit of current default behavior and can't find anything. Is there any good reason for destroying the order in the scene? Having objects with locations, rotations and scales set in relation to who-the-hell-knows what? What do I miss? Bartek Skorupa www.bartekskorupa.com On 21 wrz 2012, at 20:44, Remigiusz Fiedler mig...@gmx.net wrote: no ctrl needed, it is alt p - clear inverse parent 2012/9/21 Bartek Skorupa (priv) bartekskor...@bartekskorupa.com: Ctl-Alt-P ?? When I hit it I get a warning: Can only make proxy for a referenced object or group What do I miss? ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Make Parent - shouldn't it work differently?
I don't think it should happen by default. it could be especially nasty for animation data, linked data, etc. Also it doesn't store as much information (the relationship between child and parent at the time of parenting) which could come in handy later. However, it is not hard to do! You need for that is to multiply the inverse transform matrix with the world transform matrix. I think - I may have gotten the order wrong. so, an easy way : 1- do a normal parent operator (creates inverse transform matrix) 2- multiply the inverse transform and the regular matrix for the object 3- clear inverse transform 4- put the matrix from 2 into the transform for the object. I think 4 is a bit more complicated, because I *think* that the matrices are read-only, so you'll have to decompose into translation/rotation/scale (mathutils provides all those functions anyway) bundle that up into an operator and you're home free. Another good option is just to calculate the inverse parent and avoid doing the parent-clear inverse dance. If this is done in blender internally the same code could be used to avoid having two code paths. one possibility for blender behavior is to have a parent menu, with a few choices, similar to the un-parent, and keep the current behavior the top/default choice. On Fri, 2012-09-21 at 21:11 +0200, Bartek Skorupa (priv) wrote: Thank you. However we are only half way there. It solves the major issue as we at least don't have weird properties of the child. The question still remains: How to make a parent such that the child stays at it's current location, rotation and scale, but the values of loc/rot/scale change. This is what should happen by default. @Bassam Kurdali: You wrote: the default behaviour should be kept, of course. Most users want this. I wouldn't agree with that. I'm scratching my head trying to figure out at least one benefit of current default behavior and can't find anything. Is there any good reason for destroying the order in the scene? Having objects with locations, rotations and scales set in relation to who-the-hell-knows what? What do I miss? Bartek Skorupa www.bartekskorupa.com On 21 wrz 2012, at 20:44, Remigiusz Fiedler mig...@gmx.net wrote: no ctrl needed, it is alt p - clear inverse parent 2012/9/21 Bartek Skorupa (priv) bartekskor...@bartekskorupa.com: Ctl-Alt-P ?? When I hit it I get a warning: Can only make proxy for a referenced object or group What do I miss? ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers