Page MenuHome

Apply Visual Transform doesn't always apply location
Closed, ResolvedPublic

Description

Take a look at the attached Blend. At first the only object to which Apply Visual Transform applies location to is the cube visual_transform, which starts selected. After doing that, it seems to "unlock" location application on its child. But the other parent chain has no such condition, and location is never applied on its members.

Rotation and scale are applied in all cases.

Happens in 2.55 and also r32150, the latest SVN build.

Event Timeline

fixed r32951.

there were 2 bugs here
- applying the visual transform wasn't parent relative.
- missing update call on the objects so children were not updating.

Apply Visual Transform is now totally broken. It has no effect whatsoever, under any circumstances. r32965 on Win7 x64.

Re-Opening.

Can you explain how its broken?

The intention of visual transform is to take the result of a constraint and apply this back to the objects loc/rot/scale.

A quick test shows this to work.
- add empty in default scene
- rotate the empty
- constrain Cube to the empty (copy rotation for eg)
- set the constraint target to the empty
- Apply visual transform on the cube
- remove the constraint.

now the object is rotated as it was when constrained.

can you explain what effect you were expecting?

I was expecting the same effect from a parent/child relationship. (Using constraints works fine.)

I don't think this is needed for a parent/child relationship, since you can always apply the visual transform, then unparent with "Clear and Keep Transform".

You may also want to apply the visual transform on the child without the intention of un-parenting later on.

can you explain a situation where the old functionality was useful? (ignoring the missing refresh call for children)

My exporter makes the origin of each output mesh the location of its topmost parent, which allows separate models to be present in the same scene without either overlapping or ending up off-centre.

Clear parent and keep transform does most of what I want with much more elegance. I'm going to stick with it. :-)

for exporters I don't think these operators should be used since they modify the scene data.

You can just call something like this...
loc, rot, scale = obj.matrix_world.decompose()

Then you can apply these to the object if you like.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved.Nov 11 2010, 6:20 AM

I already create a copy of each object in order to apply some extra modifiers, so there's no harm done.

Campbell Barton (campbellbarton) renamed this task from Apply Visual Transform doesn't always apply location *NEED MORE INFO* to Apply Visual Transform doesn't always apply location.Dec 29 2014, 3:02 AM