Siera
November 21, 2018, 12:18pm
#1
Hey Guys,
I’m work on a C++ .blend parser and have already access to the most of needed data.
My mesh has 3 uv channels (texture, lightmap, shadowmap) and I have already access to the first one.
Location in DNA struct:
Object -> data -> mloopuv
struct mloopuv:
float uv[2]
float flag
My first thought was that the other two uv channels would be behind the first. But that seems not correct.
Hope you guys can give me a hint, where to find it in the DNA struct.
Thanks.
brecht
November 21, 2018, 2:03pm
#2
UVs are handled as generic custom mesh data layers. They are in the mesh->ldata
list with type CD_MLOOPUV
. All mesh data arrays are custom data layers in fact, pointers like mvert
and mloopuv
are there for convenience.
Siera
November 21, 2018, 3:22pm
#3
Hey brecht,
Thanks a lot! You saved my day!
Solution:
mesh -> ldata -> data | Data from UV channel 1
Behind this (ldata) data block is UV channel 2 and 3 (as many as you have).
ldata->type = 16 (CD_MLOOPUV)
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
This file has been truncated. show original