Re: How to fix crappy fcurves and pivots on imported Realflow RBD geometry?

2014-05-15 Thread Alok Gandhi
you plot continuous rotation (remove gimbals) by using

make rotations continous in soft image

or euler filter in maya

please note that for soft 2014 and up the make rotations continous command
has been changed to euler filter as well a la maya.


On Thu, May 15, 2014 at 3:36 PM, Morten Bartholdy x...@colorshopvfx.dkwrote:

   Thanks for both solutions Vincent. I will see if I can get it working.
 I suspect I will need an ICE tree on each piece of geometry that needs
 fixing, right!?



 I have over 2000 so I was sort of hoping I could plug a group in somewhere
 :)



  Currently I have managed a solution that allows me to render it in
 Softimage by merging the boulders into one mesh and plot its shapes with
 the merge op live. This renders fine with motionblur. The snag is I need to
 move it back into Maya for rendering it in Vray (the whole project is
 Maya/Vray - I do the fluids in XSI). When I export the shape plotted geo
 via FBX with geo cache and import that back in, the motionblur is flawed -
 see attached image.


Morten





 Den 15. maj 2014 kl. 07:11 skrev Vincent Ullmann 
 vincent.ullm...@googlemail.com:

   Hi again,

 here is another try, using ICE.
 Not totally sure if it works in all cases, but it could at least handle my
 Animation-Skills. ;-)

 Am 15.05.2014 06:54, schrieb Vincent Ullmann:

  Hi Morten,

 i dont think its possible to solve this in ICE, becouse you cant change
 the AnimationCurves
 (While tipping this i actually have a Idea)
 anyway

 I found a little snipped in the Web to get the Objects COG in Global Space
 ( https://gist.github.com/yamahigashi/9309426 )
 Now I just wrapped this in a little Loop, and created some PoseConstrains.

 After executing the Script, you just have to
 - Plot the Nulls Transforms
 - Remove the RBDs Transforms
 - Parent or Constrain or Envelope the RBD's to the Nulls

 Hope this works.
 Could'nt test this just some thoughts. ;-)
 Vincent




 Am 14.05.2014 16:22, schrieb Morten Bartholdy:

  I need to find a way to fix fcurves and pivots on a large number of
 objects (tumbling boulders) RBD simulated in Realflow (don't ask). When
 they come in they move correctly, but their pivots are way off from the
 geometry and fcurves suffer from gimbal flipping, so motionblur obviously
 doesn't render properly.



  I was thinking it would be relatively simple to get good motiondata by
 piping them through ICE, calculate motionvectors for each vertex and set
 the data again. I guess there is a way to move the pivot of each object to
 its centre too, while maintaining the same motion.


It is however way beyond my ICE capabilities, so I am looking for
 tutorials, pointers, scripts or possibly other tools that might do the
 trick.



Thanks


Morten









--


Re: How to fix crappy fcurves and pivots on imported Realflow RBD geometry?

2014-05-15 Thread Morten Bartholdy
Thanks for reminding me Alok - I had forgotten that one. It only fixes the
rotations though - I still get wonky motionblur with pivots fra from the
geometry.

Morten





Den 15. maj 2014 kl. 13:10 skrev Alok Gandhi alok.gandhi2...@gmail.com:

 you plot continuous rotation (remove gimbals) by using
 
 make rotations continous in soft image
 
 or euler filter in maya
 
 please note that for soft 2014 and up the make rotations continous command
 has been changed to euler filter as well a la maya.
 
 
 On Thu, May 15, 2014 at 3:36 PM, Morten Bartholdy  x...@colorshopvfx.dk
 mailto:x...@colorshopvfx.dk  wrote:
  Thanks for both solutions Vincent. I will see if I can get it working. I
  suspect I will need an ICE tree on each piece of geometry that needs
  fixing, right!?
  
  I have over 2000 so I was sort of hoping I could plug a group in somewhere
  :)
  
  Currently I have managed a solution that allows me to render it in
  Softimage by merging the boulders into one mesh and plot its shapes with
  the merge op live. This renders fine with motionblur. The snag is I need to
  move it back into Maya for rendering it in Vray (the whole project is
  Maya/Vray - I do the fluids in XSI). When I export the shape plotted geo
  via FBX with geo cache and import that back in, the motionblur is flawed -
  see attached image.
  
  Morten
  
  
  
  
  
  
  Den 15. maj 2014 kl. 07:11 skrev Vincent Ullmann 
  vincent.ullm...@googlemail.com mailto:vincent.ullm...@googlemail.com :
  
   Hi again,
   
   here is another try, using ICE.
   Not totally sure if it works in all cases, but it could at least handle my
   Animation-Skills. ;-)
   
   Am 15.05.2014 06:54, schrieb Vincent Ullmann:
Hi Morten,

i dont think its possible to solve this in ICE, becouse you cant change
the
AnimationCurves
(While tipping this i actually have a Idea)
anyway

I found a little snipped in the Web to get the Objects COG in Global
Space
( https://gist.github.com/yamahigashi/9309426
https://gist.github.com/yamahigashi/9309426 )
Now I just wrapped this in a little Loop, and created some
PoseConstrains.

After executing the Script, you just have to
- Plot the Nulls Transforms
- Remove the RBDs Transforms
- Parent or Constrain or Envelope the RBD's to the Nulls

Hope this works.
Could'nt test this just some thoughts. ;-)
Vincent




Am 14.05.2014 16:22, schrieb Morten Bartholdy:
 I need to find a way to fix fcurves and pivots on a large number of
 objects
 (tumbling boulders) RBD simulated in Realflow (don't ask). When they
 come
 in they move correctly, but their pivots are way off from the geometry
 and
 fcurves suffer from gimbal flipping, so motionblur obviously doesn't
 render
 properly.
 
 I was thinking it would be relatively simple to get good motiondata by
 piping them through ICE, calculate motionvectors for each vertex and
 set
 the data again. I guess there is a way to move the pivot of each
 object to
 its centre too, while maintaining the same motion.
 
 It is however way beyond my ICE capabilities, so I am looking for
 tutorials, pointers, scripts or possibly other tools that might do the
 trick.
 
 
 Thanks
 
 Morten
 
 
  
  
 
 
 
 --


Re: How to fix crappy fcurves and pivots on imported Realflow RBD geometry?

2014-05-15 Thread Morten Bartholdy
- that should have been far from the geometry. Think banana motionblur :/

MB




Den 15. maj 2014 kl. 15:19 skrev Morten Bartholdy x...@colorshopvfx.dk:

 Thanks for reminding me Alok - I had forgotten that one. It only fixes the
 rotations though - I still get wonky motionblur with pivots fra from the
 geometry.
 
 Morten
 
 
 
 
 
 
 Den 15. maj 2014 kl. 13:10 skrev Alok Gandhi alok.gandhi2...@gmail.com:
 
  you plot continuous rotation (remove gimbals) by using
  
  make rotations continous in soft image
  
  or euler filter in maya
  
  please note that for soft 2014 and up the make rotations continous command
  has been changed to euler filter as well a la maya.
  
  
  On Thu, May 15, 2014 at 3:36 PM, Morten Bartholdy  x...@colorshopvfx.dk
  mailto:x...@colorshopvfx.dk  wrote:
   Thanks for both solutions Vincent. I will see if I can get it working. I
   suspect I will need an ICE tree on each piece of geometry that needs
   fixing, right!?
   
   I have over 2000 so I was sort of hoping I could plug a group in somewhere
   :)
   
   Currently I have managed a solution that allows me to render it in
   Softimage by merging the boulders into one mesh and plot its shapes with
   the merge op live. This renders fine with motionblur. The snag is I need
   to
   move it back into Maya for rendering it in Vray (the whole project is
   Maya/Vray - I do the fluids in XSI). When I export the shape plotted geo
   via FBX with geo cache and import that back in, the motionblur is flawed -
   see attached image.
   
   Morten
   
   
   
   
   
   
   Den 15. maj 2014 kl. 07:11 skrev Vincent Ullmann 
   vincent.ullm...@googlemail.com mailto:vincent.ullm...@googlemail.com :
   
Hi again,

here is another try, using ICE.
Not totally sure if it works in all cases, but it could at least handle
my
Animation-Skills. ;-)

Am 15.05.2014 06:54, schrieb Vincent Ullmann:
 Hi Morten,
 
 i dont think its possible to solve this in ICE, becouse you cant
 change the
 AnimationCurves
 (While tipping this i actually have a Idea)
 anyway
 
 I found a little snipped in the Web to get the Objects COG in Global
 Space
 ( https://gist.github.com/yamahigashi/9309426
 https://gist.github.com/yamahigashi/9309426 )
 Now I just wrapped this in a little Loop, and created some
 PoseConstrains.
 
 After executing the Script, you just have to
 - Plot the Nulls Transforms
 - Remove the RBDs Transforms
 - Parent or Constrain or Envelope the RBD's to the Nulls
 
 Hope this works.
 Could'nt test this just some thoughts. ;-)
 Vincent
 
 
 
 
 Am 14.05.2014 16:22, schrieb Morten Bartholdy:
  I need to find a way to fix fcurves and pivots on a large number of
  objects
  (tumbling boulders) RBD simulated in Realflow (don't ask). When they
  come
  in they move correctly, but their pivots are way off from the
  geometry and
  fcurves suffer from gimbal flipping, so motionblur obviously doesn't
  render
  properly.
  
  I was thinking it would be relatively simple to get good motiondata
  by
  piping them through ICE, calculate motionvectors for each vertex and
  set
  the data again. I guess there is a way to move the pivot of each
  object to
  its centre too, while maintaining the same motion.
  
  It is however way beyond my ICE capabilities, so I am looking for
  tutorials, pointers, scripts or possibly other tools that might do
  the
  trick.
  
  
  Thanks
  
  Morten
  
  
   
   
  
  
  
  --
 
 


Re: How to fix crappy fcurves and pivots on imported Realflow RBD geometry?

2014-05-15 Thread jentzen mooney
Vincent,

Another method, is keeping the fcurves the way they are, would be to use an
ice tree or script to define new user motion on the meshes. So the motion
blur is calculated properly.

On Wednesday, May 14, 2014, Vincent Ullmann vincent.ullm...@googlemail.com
wrote:

  Hi again,

 here is another try, using ICE.
 Not totally sure if it works in all cases, but it could at least handle my
 Animation-Skills. ;-)

 Am 15.05.2014 06:54, schrieb Vincent Ullmann:

 Hi Morten,

 i dont think its possible to solve this in ICE, becouse you cant change
 the AnimationCurves
 (While tipping this i actually have a Idea)
 anyway

 I found a little snipped in the Web to get the Objects COG in Global Space
 (https://gist.github.com/yamahigashi/9309426)
 Now I just wrapped this in a little Loop, and created some PoseConstrains.

 After executing the Script, you just have to
 - Plot the Nulls Transforms
 - Remove the RBDs Transforms
 - Parent or Constrain or Envelope the RBD's to the Nulls

 Hope this works.
 Could'nt test this just some thoughts. ;-)
 Vincent




 Am 14.05.2014 16:22, schrieb Morten Bartholdy:

  I need to find a way to fix fcurves and pivots on a large number of
 objects (tumbling boulders) RBD simulated in Realflow (don't ask). When
 they come in they move correctly, but their pivots are way off from the
 geometry and fcurves suffer from gimbal flipping, so motionblur obviously
 doesn't render properly.



  I was thinking it would be relatively simple to get good motiondata by
 piping them through ICE, calculate motionvectors for each vertex and set
 the data again. I guess there is a way to move the pivot of each object to
 its centre too, while maintaining the same motion.


It is however way beyond my ICE capabilities, so I am looking for
 tutorials, pointers, scripts or possibly other tools that might do the
 trick.



Thanks


Morten








How to fix crappy fcurves and pivots on imported Realflow RBD geometry?

2014-05-14 Thread Morten Bartholdy
I need to find a way to fix fcurves and pivots on a large number of objects
(tumbling boulders) RBD simulated in Realflow (don't ask). When they come
in they move correctly, but their pivots are way off from the geometry and
fcurves suffer from gimbal flipping, so motionblur obviously doesn't render
properly.

I was thinking it would be relatively simple to get good motiondata by
piping them through ICE, calculate motionvectors for each vertex and set
the data again. I guess there is a way to move the pivot of each object to
its centre too, while maintaining the same motion.

It is however way beyond my ICE capabilities, so I am looking for
tutorials, pointers, scripts or possibly other tools that might do the
trick.


Thanks

Morten

Re: How to fix crappy fcurves and pivots on imported Realflow RBD geometry?

2014-05-14 Thread Vincent Ullmann

Hi Morten,

i dont think its possible to solve this in ICE, becouse you cant change 
the AnimationCurves

(While tipping this i actually have a Idea)
anyway

I found a little snipped in the Web to get the Objects COG in Global 
Space (https://gist.github.com/yamahigashi/9309426)

Now I just wrapped this in a little Loop, and created some PoseConstrains.

After executing the Script, you just have to
- Plot the Nulls Transforms
- Remove the RBDs Transforms
- Parent or Constrain or Envelope the RBD's to the Nulls

Hope this works.
Could'nt test this just some thoughts. ;-)
Vincent




Am 14.05.2014 16:22, schrieb Morten Bartholdy:


I need to find a way to fix fcurves and pivots on a large number of 
objects (tumbling boulders) RBD simulated in Realflow (don't ask). 
When they come in they move correctly, but their pivots are way off 
from the geometry and fcurves suffer from gimbal flipping, so 
motionblur obviously doesn't render properly.


I was thinking it would be relatively simple to get good motiondata by 
piping them through ICE, calculate motionvectors for each vertex and 
set the data again. I guess there is a way to move the pivot of each 
object to its centre too, while maintaining the same motion.



It is however way beyond my ICE capabilities, so I am looking for 
tutorials, pointers, scripts or possibly other tools that might do the 
trick.




Thanks


Morten





xsi = Application


From  https://gist.github.com/yamahigashi/9309426;
def calc_cog_global_position(obj):
''' calculate objects cog position in global space. returns vector3 '''

#x, y, z, b1, b2, b3 = 
Application.Selection(0).ActivePrimitive.Geometry.GetBoundingBox()
#v = XSIMath.CreateVector3(x, y, z)
if obj.ActivePrimitive.Geometry is not None:
x = obj.ActivePrimitive.Geometry.Points
v = XSIMath.CreateVector3()
for p in x:
v.Add( v, p.Position) 
v.Scale(1.0 / x.Count, v)
res = 
XSIMath.MapObjectPositionToWorldSpace(obj.Kinematics.Global.Transform, v)
 
return res
 
else:
t = obj.Kinematics.Global.Transform
return XSIMath.CreateVector3(t.PosX, t.PosY, t.PosZ)
 
 

xsi.SetUserPref(SI3D_CONSTRAINT_COMPENSATION_MODE, 1)

# Store Sel
sel = []
for obj in xsi.Selection:
sel.append(obj)

for obj in sel:
objCOG = calc_cog_global_position(obj)
print Obj:  + obj.Name +  // COG: ( + str(objCOG.X) + / + 
str(objCOG.Y) + / + str(objCOG.Z) + )

null = xsi.GetPrim(Null, poseCons_ + obj.Name, , )
xsi.Translate(null, objCOG.X, objCOG.Y, objCOG.Z, siAbsolute, 
siPivotCOG, siObj, siXYZ, , , , , , , , , , 0, )

xsi.ApplyCns(Pose, null, obj, True)

xsi.SetUserPref(SI3D_CONSTRAINT_COMPENSATION_MODE, 0)