﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5953	Broken visualization code generation for models with components having same name	anonymous	Volker Waurich	"Model '''VisualizationBug''' has two shapes with the same name '''body.sphere''' and '''foo.body.sphere''' and '''body.sphere''' is missing from 3D animation scene in OMEdit.

{{{#!modelica
model VisualizationBug
  model Foo
    Modelica.Mechanics.MultiBody.Parts.Body body(
      angles_fixed = true, m = 1, r_CM = {0, 0, 0},
      r_0(each fixed = true, start = {0, 0, 0}),
      v_0(each fixed = true), w_0_fixed = true
    );
  end Foo;

  Modelica.Mechanics.MultiBody.Parts.Body body(
    angles_fixed = true, m = 1,
    r_0(each fixed = true, start = {0, 1, 0}), 
    r_CM = {0, 0, 0}, v_0(each fixed = true), w_0_fixed = true);
  
  inner Modelica.Mechanics.MultiBody.World world;
  
  VisualizationBug.Foo foo;
end VisualizationBug;
}}}

I think that's because  compiler generates wrong '''*_vis.xml''' file and shape '''body.sphere''' use '''foo.body.sphere''' parameters.

{{{#!xml
<shape>
  <ident>body.sphere</ident>
  <type>sphere</type>
  <T>
    <cref>foo.body.sphere.R.T[1,1]</cref>
    <cref>foo.body.sphere.R.T[1,2]</cref>
    <cref>foo.body.sphere.R.T[1,3]</cref>
    <cref>foo.body.sphere.R.T[2,1]</cref>
    <cref>foo.body.sphere.R.T[2,2]</cref>
    <cref>foo.body.sphere.R.T[2,3]</cref>
    <cref>foo.body.sphere.R.T[3,1]</cref>
    <cref>foo.body.sphere.R.T[3,2]</cref>
    <cref>foo.body.sphere.R.T[3,3]</cref>
  </T>
  <r>
    <cref>foo.body.sphere.r[1]</cref>
    <cref>foo.body.sphere.r[2]</cref>
    <cref>foo.body.sphere.r[3]</cref>
  </r>
  <r_shape>
    <cref>foo.body.sphere.r_shape[1]</cref>
    <cref>body.sphere.r_shape[2]</cref>
    <cref>body.sphere.r_shape[3]</cref>
  </r_shape>
  ...
</shape>
}}}"	defect	assigned	high		Code Generation				
