I've tried to include a second U3D model to my document and got the following error:
! LaTeX error: "kernel/command-already-defined"
!
! Control sequence \l_mix_vfile_stream already defined.
The (minimal) code to include the models is:
% COMPILED WITH PDF LATEX
% USING THE UP-TO-DATE VERSIONS OF media9 AND l3kernel
\documentclass[ a4paper, 11pt, twoside, openleft ]{book}
\usepackage[dvipdfmx]{media9}
\begin{document}
% Include model1
\includemedia[%
activate=onclick,%
deactivate=pageinvisible,%
3Dviews=model1.vws]{}%
{model1.u3d}% Binary file
% Include model2
\includemedia[%
activate=onclick,%
deactivate=pageinvisible,%
3Dviews=model2.vws]{}%
{model2.u3d}% Binary file
\end{document}
.u3d files are binary and the .vws looks like:
% modelX.vws - Nothing special here.
VIEW=MATLABfig
COO=0.35 0.35 0.05
C2C=3.8613 -4.3644 1.671
ROO=0.596
ROLL=0
ORTHO=0.83893
PART=Mesh1
RENDERMODE=SolidWireframe
END
PART=Mesh2
RENDERMODE=SolidWireframe
END
END
The error disappears if I remove the 3Dviews options from one of them. But then I cannot configure the rendering of one model (transparency, light, etc).
I'm not familiar to the internals of latex, but looking at media9.sty it is clear that the command
\l_mix_vfile_stream
is used to open/close the .vws file.
Is this a bug from media9? or from latex 3?
media9: the declaration\ior_new:N\l_mix_vfile_streamshould go outside the definition of\includemedia. – egreg Sep 28 '12 at 22:00