Blender Logo on Helmet how to export for spark ar - blender

I have a hard hat that I added a logo to with a shrinkwrap in Blender. But I can't seem to get the file exported to be able to use in SparkAR. I also can't get the meshes to join as one mesh.

I can't seem to get the file exported
SparkAR supports .fbx format, you should select it when exporting.
Following 3D file formats supported:
FBX 2015 (binary and ASCII versions).
gITF 2 (binary and text versions).
OBJ.
DAE.
It's really easy to export too:
If this didn't solve your problem, provide more details on what's going wrong when you're exporting/importing your mesh.
I also can't get the meshes to join as one mesh
To join meshes select them both and press ctrl + j

Related

Unreal Datasmith Export - How to set Pivotpoint of Datasmith Mesh?

i'm currently developing a Datasmith export feature for an AutoCAD plugin. I'm almost done but I can't figure out how to set the pivot point of a mesh.
I've sticked to the SDK Guidelines here:
https://docs.unrealengine.com/5.0/en-US/datasmith-export-sdk-guidelines/
At some point it says
Mesh pivots must be calculated in the mesh so they don't all end up at 0, 0, 0.
Which is something I whould like to do but I can't find a way in the SDK to set the pivot...
I've expected a function like SetPivotPoint(x,y,z) or something like that on one of these types:
FDatasmithMesh
IDatasmithMeshElement
IDatasmithMeshActorElement
... But nothing :(
Any help please?
I've just understood what is meant by "the pivot point must be baked into the mesh". I've took all the points of the AutoCAD geometries and created meshes out of them as they are. But the mesh itself must be builded around the point where I want the pivot point to be (relative to the mesh).
So I think the correct way to do this is to translate all the points of the ACAD geometry so that the center point (where I want the pivot to be) is 0,0,0.
Then I build the mesh around it and translate the mesh actor, that holds the instance of the mesh, to the position in the scene where the mesh should be.
Edit: That was exactly the solution...just in case anyone else has the same problem.

Using mathtext parser to output a svg file

Context
I'm looking for a simple way to import properly typeset mathematics (with LaTeX) into blender. A solution for this has already been given. But that means getting out of blender, using multiple tools and then going back to blender and importing the whole thing.
Blender comes with Python and can import svg
I'd like to find an other way and blender has a set of powerful tools based on Python. I was thinking: can I make Python parse some TeX input and then generate a svg (virtual) file inside blender. That would solve the problem.
matplotlib "emulates" TeX
It is possible to install any Python library and use it inside blender. So this made me think of a possible "hack" of matplotlib.
mathtext is a module that provides a parser for strings with TeX-like syntax for mathematical expressions. svg is one of the available "backends".
Consider the following snippet.
import matplotlib.mathtext as mathtext
parser = mathtext.MathTextParser('svg')
t = parser.parse(r'$\int_{0}^{t} x^2 dx = \frac{t^3}{3}$')
t is a tuple that has all the information needed. But I can't find a way (in the backend api) to convert it to a (virtual) svg file.
Any ideas?
Thanks
Matplotlib needs a figure (and currently also a canvas) to actually be able to render anything. So in order to produce an svg file whose only content is a text (a mathtext formula) you still need a figure and a canvas and the text needs to actually reside inside the figure, which can be achieved by fig.text(..).
Then you can save the figure to svg via fig.savefig(..). Using the bbox_inches="tight" option ensures the figure to be clipped to the extent of the text. And setting the facecolor to a transparent color removes the figure's background patch.
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.figure import Figure
fig = Figure(figsize=(5, 4), dpi=100)
canvas = FigureCanvasAgg(fig)
fig.text(.5, .5, r'$\int_{0}^{t} x^2 dx = \frac{t^3}{3}$', fontsize=40)
fig.savefig("output.svg", bbox_inches="tight", facecolor=(1,1,1,0))

Exporting map from TileMill to PDF/SVG

I have such a big problem with exporting and importing map from TileMill to Illustrator/Inkscape. The problem is with strokes of labels / names.
It seems that TileMill export each letter of label as a separate expanded path–object and doing an outline of that. The result is very bad. Take a look: http://cl.ly/image/0Z2o2v3v2r2C
Do you have any ideas how to fix it? Or maybe there is a solution to create a working text path in Illustrator from that kind of object?
This is unfortunately an upstream bug in Mapnik, and upstream from there in the raw SVG rendering libraries it uses.

Exporting animations from blender to use with Assimp

I noticed that if I export my blender project as a obj-file I have the option to toggle "Export Animation" which will make alot of files, one for each frame.
I wanted to use the Collada (.dae) format to export my animations. Problem is, when I load my Collada file it says that NumAnimations == 0!
1) Why does a file that is supposed to store animation say 0 animation?
2) When I do get it to work, how to I swap between frames in Assimp?
1) Animation import should work, your problem is probably the export. Have you tried reading through your collada file? Watch for <library_animations> and the like.
2) Assimp has no notion of frames. aiAnimation consists of multiple channels (aiNodeAnim) which define transformations (keyframes) for nodes at specific ticks/time. To compute all transformations one needs to interpolate the correct keyframes depending on the current playback time and mTicksPerSecond of aiAnimation.

Maya: Create temporary MFnMEsh for smooth export

Im writing an exporter that exports the subdivision preview mesh via the 'generateSmoothMesh()' method like this:
MFnMesh mesh(mesh_dag_path);
MFnMesh subdiv_mesh(mesh.generateSmoothMesh());
but after the export finishes the new subdivided geometry is left in my maya scene. How should i deal with this geometry, or is this even the right way to be doing this export?
my first instinct is to delete the geometry after the export is finished, if this is the correct thing to do does anybody know he correct way to delete the geometry from the api
Saying you need to do it from the API makes me think this is a command plugin. Correct me if I'm wrong. One way to do it is to run MEL code from your plugin with MGlobal .
MGlobal::executeCommand(MString("delete meshTransform;"));
Where meshTransform is the transform of the newly created mesh. You can get it by having parentOrOwner be MObject::kNullObj.
Or you can directly use:
MGlobal::deleteNode()