CTRL + P Parenting = Logic parenting?

Hi all-

Simple question, does the CTRL + P parent method equal the logic block parent/ unparent ? I have a situation where I need to have an object pre-parented as the object is created, but when I try to unparent an object (via logic block) that has been parented using CTRL + P it does not work.

Is there a way of achieving this?

Cheers

Paul

hi, with python can write:

obj.removeParent()

(if not change in 2.59)

probably you want this (think)

if the new object is started from python and would leave the parent must write this:

#################
addNEWOBJECT=scene.addObject(“Cube”, obj,0)
addNEWOBJECT.removeParent()
#################

addNEWOBJECT is variable of fantasy , you can write

#################
EEE=scene.addObject(“Cube”, obj,0)
EEE.removeParent()
#################
:wink:

however, even works with logic bricks

I tried to add an object that was the parent of another object,
when I press U, the actuator “parent” relationship eliminates the parent

did you mess with some builds?:D:spin::rolleyes:

also gave me some problems I do not remember if it was 2:57?
perhaps more old (2.4x)

I will have to try those, but I run 2.59…will report back later!

Nope, still no luck- here is a blend. file> am I doing something stupid? I have a static block (top) with a dynamic cube (below) parented to it. If I use pure logic to parent/ unparent its fine…

Edit: here is a Python version, no errors in console. I have tried this on three versions and its all the same.

Could you post your working example, Marco?

Attachments

Unparent.blend (431 KB)UnparentPython.blend (433 KB)

Hm. There must be a bug out of trunk builds… Try a newer one off of GraphicAll. You could also parent it at the beginning using code, and then unparent it later (which you’ve tried). Here’s an example.

UnparentPythonFix.blend (399 KB)

I think there is a MAJOR bug somewhere- added objects seem to double in size when added and are not centred on the parents origin.

In this blend. , add an object by clicking on the ‘2’ button (using the left mouse button), and then add another object by right clicking anywhere… the object is totally wrong. And this happens on several builds, official and unofficial.

You also cannot add an object that is parented with another via the add object actuator either. Its frustrating!!! I need this for my game- if I cant have it I’m going to need to get a bit creative to get round it.

Attachments

Problem.blend (419 KB)

You needed to apply the scaling on the sphere, from which the cube is spawned, which has its scale set relative to the sphere. You can add parented objects (like an NPC’s collision box, which has an armature and mesh parented to them).

yes , now see your blend :wink:

yes… work all , python and no-python

for all reperat SolarLune in range(1)
:smiley:

you have solved problem of parent?

however it is always better to have the original scale, regardless, to be sure …

Simply choose the object, Ctrl + A -> Reset Scale,Reset Rotation , Reset Location (reset all)

in this case was the sphere that had the scale “wrong”

Hmmm, so I’ve fallen for the old CTRL + A trap? Doh!:o I tried it and it works- the only thing left to fix is the location- although I explicitly say to spawn at the objects origin, the second object added (the cuboid) spawns well away from the icosphere. Is there a way to fix that? (I’ve attached the blend at a perspective that shows this- just do the same selection process as the first Problem.blend). I’ve tried reseting the origin (CTRL + A) but this just mixes this up further).

And thanks for the help, too! One day, I will be a Blender god!

Attachments

Problem2.blend (419 KB)

this is unparent with python and logic,

press P and unparent with python the cube at left
press L and unparent with logic brick the cube at right

in all case must stop the rotation:yes:

Attachments

Unparent(python-logic).blend (432 KB)

Thanks Marco- the child cubes when unparented stop in mid air (even though they are dynamic)- they do not fall down. Is this normal?

the 2.57 was a little different (with ctrl + A resets the position to 0,0,0)

still controls the position of the object’s center … is that the error
do

alt + G (to reset 0,0,0)
CTRL + A (location apply)
and should remain centered around! I believe!

not think :confused:

gravity how is setup?