Skip to content

Commit

Permalink
Issue #222 -> Compile problems Energy obj references mtl as txt
Browse files Browse the repository at this point in the history
  • Loading branch information
stathisnikolaidis committed Nov 8, 2017
1 parent 2b58c1f commit c669e9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/wpunity-core-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ function wpunity_create_asset_3DFilesExtra_frontend($asset_newID, $assetTitleFor
$mtlFile_filename = basename(get_attached_file($mtlFile_id));

// OBJ
$obj_content = preg_replace("/.*\b" . 'mtllib' . "\b.*\n/ui", "mtllib " . $mtlFile_filename . "\n", $obj_content);
$mtlFile_filename_notxt = substr( $mtlFile_filename, 0, -4 );
$mtlFile_filename_withMTLext = $mtlFile_filename_notxt . '.mtl';
$obj_content = preg_replace("/.*\b" . 'mtllib' . "\b.*\n/ui", "mtllib " . $mtlFile_filename_withMTLext . "\n", $obj_content);
$objFile_id = wpunity_upload_AssetText($obj_content, 'obj'.$assetTitleForm, $asset_newID, $gameSlug);

// SCREENSHOT
Expand Down

0 comments on commit c669e9b

Please sign in to comment.