Skip to content

Conversation

@thor-shuang
Copy link

No description provided.

Comment on lines 2 to 9
"""
@File : asset_introduction.py
@Vision : 1.0.0
@Time : 2019/10/3 17:34
@Author : Qing Shuang
@Email : 2075693226@qq.com
@Software: PyCharm
"""
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些在大型项目中不应当出现

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Copy link
Contributor

@sol87 sol87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

暂时这么多

Comment on lines 2 to 9
"""
@File : asset_introduction.py
@Vision : 1.0.0
@Time : 2019/10/3 17:34
@Author : Qing Shuang
@Email : 2075693226@qq.com
@Software: PyCharm
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

project_path = r'C:\Users\qingshuang\Documents\code\MyItem\td_study\mid_term_work\AssetIO\example\project'
target_path = r'C:\Users\qingshuang\Documents\code\MyItem\td_study\mid_term_work\AssetIO\example\project\TDC'
bake_path = r'C:\Users\qingshuang\Documents\code\MyItem\td_study\mid_term_work\AssetIO\example\project\TDC.bake'
record_original_file(asset_path=original_asset_path, output_path=project_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

调用函数缺乏状态获取

if root == asset_path:
original_file_structure['Inbox'] = dirs + files
else:
dict_key = root.split('\\')[-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个切分不是很保险

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dict_key这个变量名不好

else:
dict_key = root.split('\\')[-1]
original_file_structure[dict_key] = dirs + files
if len(files) > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个判断没有意义

dict_key = root.split('\\')[-1]
original_file_structure[dict_key] = dirs + files
if len(files) > 0:
for file in files:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file关键字不能用

original_file_structure[dict_key] = dirs + files
if len(files) > 0:
for file in files:
file_path = f'{root}\\{file}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.join可能会更好。最好,可以用Path类型来做

# 创建必需的文件夹结构
filter_path = target_path
for filter_name in ['Project', project_code, 'Asset', ['Cha', 'Env', 'Prop']]:
if isinstance(filter_name, str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个判断是为了解决自己制造出来的麻烦?

def transfer_asset(target_path, bake_path):
"""转移资产并记录文件的原始名字和修改后的名字"""
# 创建必需的文件夹结构
filter_path = target_path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要重定义一个filter_path变量

# 读取bake文件,提取所有文件名
with open(bake_path, 'rb') as file_structure:
all_info_list = pickle.load(file_structure)
file_info_dict = all_info_list[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file_structure, file_info_dict = *all_info_list

这么写也不一定是好的,但是它更加的清晰

Copy link
Author

@thor-shuang thor-shuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

卿爽的第二版中期作业,修改了上次课中提到的问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants