Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
momo 2023-11-27 16:50:17 +08:00
commit 602e77aef9

View File

@ -363,10 +363,6 @@ func (w *wsConnectItem) getProductRelationInfo(renderImageData *websocket_data.R
// 组装数据发送给unity
func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int, combineImage string, info websocket_data.RenderImageReqMsg, productTemplate *gmodel.FsProductTemplateV2, model3dInfo *gmodel.FsProductModel3d, element *gmodel.FsProductTemplateElement, productSize *gmodel.FsProductSize) (err error) {
/*if w.userId != 127 {
w.renderErrResponse(info.RequestId, info.RenderData.TemplateTag, taskId, "测试拦截,稍后开放", info.RenderData.ProductId, w.userId, w.guestId, productTemplate.Id, model3dInfo.Id, productSize.Id, *productTemplate.ElementModelId)
return err
}*/
//组装数据
refletion := -1
if element.Refletion != nil && *element.Refletion != "" {
@ -408,80 +404,15 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
})
}
if element.ModelP != nil && *element.ModelP != "" {
/*tempData = append(tempData, map[string]interface{}{
tempData = append(tempData, map[string]interface{}{
"name": "model_P",
"data": "0," + *element.ModelP,
"type": "other",
"layer": "0",
"is_update": 0,
"mode": mode["model_P"],
})*/
})
}
//×××××××××××××××××××××××××××××××××××××××××××××××××××××
if w.userId == 127 && info.RenderData.ProductId == 32 {
if element.Base != nil && *element.Base != "" {
tempData = append(tempData, map[string]interface{}{
"name": "model_1",
"data": "0," + combineImage + "," + *element.Base,
"type": "other",
"layer": "0",
"is_update": 1,
"mode": mode["model"],
})
}
if element.Shadow != nil && *element.Shadow != "" {
tempData = append(tempData, map[string]interface{}{
"name": "shadow_1",
"data": *element.Shadow,
"type": "other",
"layer": "0",
"is_update": 0,
"mode": mode["shadow"],
})
}
/*if element.ModelP != nil && *element.ModelP != "" {
tempData = append(tempData, map[string]interface{}{
"name": "model_P_1",
"data": "0,",
"type": "other",
"layer": "0",
"is_update": 0,
"mode": mode["model_P"],
})
}*/
if element.Base != nil && *element.Base != "" {
tempData = append(tempData, map[string]interface{}{
"name": "model_2",
"data": "0," + combineImage + "," + *element.Base,
"type": "other",
"layer": "0",
"is_update": 1,
"mode": mode["model"],
})
}
if element.Shadow != nil && *element.Shadow != "" {
tempData = append(tempData, map[string]interface{}{
"name": "shadow_2",
"data": *element.Shadow,
"type": "other",
"layer": "0",
"is_update": 0,
"mode": mode["shadow"],
})
}
if element.ModelP != nil && *element.ModelP != "" {
tempData = append(tempData, map[string]interface{}{
"name": "model_P_2",
"data": "0," + *element.ModelP,
"type": "other",
"layer": "0",
"is_update": 0,
"mode": mode["model_P"],
})
}
}
//××××××××××××××××××××××××××××××××××××××××××××××××××××
result := []interface{}{
map[string]interface{}{
"light": *element.Light,
@ -494,22 +425,6 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
"data": tempData,
},
}
//**************************
if w.userId == 127 && info.RenderData.ProductId == 32 {
result = []interface{}{
map[string]interface{}{
"light": 22,
"refletion": refletion,
"scale": 5,
"sku_id": info.RenderData.ProductId,
"tid": "ceshi",
"rotation": *element.Rotation,
"filePath": "", //todo 文件路径,针对千人千面
"data": tempData,
},
}
}
//*******************************
//发送运行阶段消息(组装数据)
w.sendAssembleRenderDataStepResponseMessage(info.RequestId)
temId := websocket_data.ToUnityIdStruct{